For centuries, societies have erected walls and fences to separate themselves from their neighbors, from the Great Wall of China through the Berlin Wall right up to the barrier that today divides Israel from the Palestinians on the West Bank.

The United States has debated putting up security barriers of its own along the Southwest border and has spent billions of dollars in recent years fencing in one-third of it.

Now, Donald Trump is proposing to go even further, vowing to build a massive, impenetrable wall along the U.S.-Mexico frontier to keep out illegal Mexican migrants.

“Building a wall is easy, and it can be done inexpensively,” he said in an interview, discussing what has become the signature proposal of his campaign. “It’s not even a difficult project if you know what you’re doing.”

But any wall-building effort would cost billions of dollars and encounter a variety of obstacles, according to experts, documents and federal officials, including some of the same difficulties that bedeviled the federal government as it spent more than $7 billion on border fencing. The obstacles include environmental and engineering problems; fights with ranchers and others who don’t want to give up their land; and the huge topographical challenges of the border, which runs through remote desert in Arizona to rugged mountains in New Mexico and, for two-thirds of its length, along rivers.

“It’s extremely challenging to put a brick-and-mortar wall along the southwest border for any number of reasons,” said Richard Stana, who wrote multiple reports on border security for the nonpartisan Government Accountability Office before retiring in 2011. “It seems very simplistic.”

If such a barrier could be erected, experts and government officials agreed that making it impenetrable is virtually impossible, as is completely securing the entire 1,954-mile border. The Department of Homeland Security already is spending millions of dollars per year to maintain existing fences and repair breaches, according to government reports and officials, while drug traffickers and smugglers are increasingly using tunnels to dig underneath.

While a wall along much of the border theoretically might be possible, said Thad Bingel, former senior U.S. Customs and Border Protection official, “is it desirable? At what cost, and what do you give up to pay for that?”

Bingel, who was involved in border fence-building during the George W. Bush administration and is now a partner at Command Consulting Group in Washington, added “every wall can be circumvented. People can go under it, they can go over it. … No one should go into this with the idea that if you just build the right kind of wall, no one will get through.”

Trump disputed that, saying a wall “would be very effective” in deterring illegal migrants and that seismic and other equipment could detect and stop any underground tunnels.

“A wall is better than fencing, and it’s much more powerful,” he said. “It’s more secure. It’s taller.”

The veteran builder acknowledged that environmental impact studies would be difficult but said he is the one person who can rise to the challenge.

“I’m considered a great builder, by everybody,” he said, adding that cost is irrelevant because he would force Mexico to pay for the structure. Asked whether that was realistic, Trump said, “it’s realistic if you know something about the art of negotiating. If you have a bunch of clowns negotiating, it’s not realistic.”

Trump has emerged as a leading candidate partly because of his strong statements about immigration, which have included describing Mexicans entering the country illegally as “rapists” and “murderers.” He has suggested at times that his proposed wall would be extensive and cover nearly the entire border but said in the interview, “you don’t have to build it in every location. There would be some locations where you would have guards, where you don’t need it because the topography acts as its own wall, whether that’s water or very rough terrain.”

The concept of a wall or fence along virtually the entire border has bubbled up occasionally in the nation’s immigration debate, with several Republicans supporting the idea. Today, there are more than 45 such walls and border fences worldwide, perhaps most prominently Israel’s West Bank barrier.

While Israeli officials say it has reduced attacks, security specialists say that barrier, slated to be more than 400 miles when finished, is not comparable to what would be required along the far more extensive U.S. southwest border. The Israelis, they add, rely supplement the physical concrete barrier with a mix of border police and other technology, much as the Department of Homeland Security does in the United States.

In any event, a variety of experts said, the highly militarized nature of the Israeli structure and the Berlin Wall that once divided West and East Germany — infamous for its guard towers and other fortifications — probably would never gain widespread political support in the United States.

The U.S. government began building border fencing near San Diego in 1990. As DHS cracked down on illegal immigration after the Sept. 11, 2001, attacks, then-President George W. Bush signed into law the Secure Fence Act of 2006, which dramatically expanded the effort. Spending on border fencing and related infrastructure such as lighting shot up from $298 million in 2006 to $1.5 billion the following year, according to the nonpartisan Congressional Research Service.

Overall, more than $7 billion has been used to build what is 653 miles of southwest border fencing — costing nearly $5 million per mile in some spots — nearly half in Arizona. More than 350 miles of that is pedestrian fencing, generally mesh structures that are 8 feet to 15 feet high. The remainder is designed to stop vehicles.

The costs could increase substantially if extensive new fencing is built, because it would be in increasingly remote regions without roads and in mountainous terrain, according to Marc Rosenblum, deputy director of the U.S. immigration policy program at the Migration Policy Institute. Adding even more to the expense, he said, would be acquiring private land near the border and maintaining existing fencing.

Trump’s wall likely would cost far more than fencing, Stana said, given the expanded need for construction materials and labor.

Cost estimates are elusive, partly because the concept of a wall has never gained traction inside the U.S. government. Current and former DHS officials said a wall has never been seriously considered.

And while the officials say the fencing has been effective in deterring illegal immigration, they say it is only one part of a broader border strategy that includes expanded sensors, drones and other technology, along with growing numbers of U.S. Border Patrol officers.

“Our southern border is a mixture of winding river, desert and mountains. Simply building more fences is not the answer,” DHS secretary Jeh Johnson said in an October speech. He cited his predecessor as secretary, Janet Napolitano, a former Arizona governor as saying, “Build a 50-foot fence, and I’m sure someone else will build a 51-foot ladder.”

The government’s difficulties in erecting fences highlight the challenges of building a wall, experts said. The fencing mandated by Congress in 2006 was beset by delays, surging construction costs and disputes with private property owners, mostly in Texas, DHS officials have said.

The biggest failure was the virtual fence, a George W. Bush administration effort to cover the border with a high-tech surveillance system. Known as SBInet, the plan was canceled by the Obama administration in 2011 after it fell seven years behind schedule and ran into technical problems with cameras and radar. In the end, the government spent nearly a billion dollars to cover 53 miles in Arizona.

“It’s a huge effort to construct anything at the border,” said one DHS official, who has worked in Republican and Democratic administrations and spoke on the condition of anonymity because Trump’s plan is part of a political campaign. “You have lots of requirements to do construction: the environmental piece, engineering assessments. And a private landowner might not want fencing.”

Wayne Cornelius, director of the Mexican migration field research program at the University of California at San Diego, called Trump’s proposal “ludicrous. … Any physical barrier can be tunneled under or climbed over or gotten around. There will always be gaps, and smugglers and migrants will seek out those gaps and go through.”

Washington Post writers Robert Costa and Alice Crites contributed to this report.