Until 1990, some of America’s most substantial physical barriers were private fences, built by ranchers to corral cattle.

That changed that year, when the U.S. Border Patrol constructed the first formal physical barrier along the border with Mexico — to keep out people.

It was just the start.

But fences created to stop border-crossers succeeded mostly in pushing people away from fortified points on the line, causing them to travel through more rugged and remote terrain in which many of them died, according to a legal brief by the National Immigration Law Center.

The Los Angeles-based immigration advocate relied on multiple studies of the construction and impact of U.S. border barriers. The research was contained in a court brief that the NILC filed this month in California, in opposition to President Donald Trump’s plan for a big, expensive border wall.

Between 1996 and 2000, Arizona and Texas saw 1,000 percent increases in migrant deaths, as people fell prey to dehydration, hypothermia, and sunstroke. By 2004, more than 2,900 deaths occurred at the border, the NILC said.

The Border Patrol recorded 7,505 migrant deaths along the Southwest line between 1998 and 2018, agency records show. Border Angels, a San Diego-based group that leaves jugs of water on migrant desert paths, puts the total at 10,000 since 1994.

“Walls work, and walls save lives,” Trump has declared, having described immigrants as rapists and criminals.

In February, Trump declared a national emergency at the border so he could divert money already approved by Congress to a different purpose, the construction of barriers on the border.

Crossings by undocumented immigrants have surged to record levels in the last few months, according to U.S. Customs and Border Protection.

Last week, government officials announced that the Pentagon would shift $1.5 billion from the support of Afghan security forces to help pay for construction of 80 miles of border wall. That follows a March reallocation of $1 billion.

The construction of big-budget border walls has exploded around the world in the last 15 years, driven largely by the desire to block the flow of millions of refugees and migrants fleeing war or poverty. Today about 70 walls have been built, with more planned or under construction, compared with about five at the end of World War II.

The problem, studies show, is that they often don’t work as promised.

The NILC brief, filed in support of the State of California’s lawsuit against the Trump administration over the wall, focuses on the impact of early barriers in the American Southwest.

The Border Patrol’s 1990 construction of what became known as the “primary fence” was followed by the walls, fencing, and physical barriers of “Operation Gatekeeper,” all aimed at discouraging, delaying, and detecting migrants.

The layers that went up around the primary fence created a “wall” along a 14-mile stretch of the California-Mexico border, from the Pacific Ocean to the Otay Mountains. Twelve of those miles were dotted with stadium lights.

Fence-building was expanded in El Paso, Texas, and in Nogales, Yuma, and Tucson, Ariz.

But the barriers only redirected migrants, the NILC filing asserted.

Between 1994 and 2000, apprehensions in San Diego dropped 66 percent — but grew 351 percent in the Tucson and Yuma sectors as migrants were pushed east.

Migration journeys became more difficult and dangerous.

“The harms flowing from the radically expanded border fencing that the Trump administration is attempting,” the NILC filing said, “will be similarly, if not more, catastrophic than those taken by the executive [branch] in the 1990s.”