The Border Patrol had to ride to the rescue of three migrants Sunday after they got stuck on top of President Trump’s border wall in San Diego.

The man and two women tried to use dense fog to cover their attempt to climb a section of 30-foot-high fence — part of nearly 100 miles of replacement wall built under Mr. Trump.

They cleared the primary fence up along the border but became stuck atop the fog-slicked secondary fence, which is set back from the boundary line, creating an enforcement corridor between the two fences.

It’s not clear how they managed to scale the two walls, though Customs and Border Protection suggested they likely had smugglers who were helping them but then abandoned them when they got stuck.

Agents called out the San Diego Fire Department, which had to use a truck and lengthy extension ladder to get the migrants down.

All three were determined to be in the country without permission.

“These three were very fortunate to not have fallen from the top of the wall, which could have resulted in serious injury or death,” said Aaron Heitke, acting chief patrol agent in the San Diego sector. “These dangers are not important considerations to smugglers, who place an emphasis on profits over safety.”

Falls from the wall do happen, said Supervisory Agent Jeffrey R. Stephenson, who said agents then rush them to medical attention.

“The falls have led to numerous serious injuries including broken legs, broken ankles, skull fractures, brain bleeds, broken scapula, fractured vertebrae and appendicitis,” he said.

The wall is the most visible of Mr. Trump’s get-tough efforts on illegal immigration, though its effectiveness in stemming last year’s surge in the flow of immigrants is heatedly debated.

Most analysts say the wall is more effective on drug-trafficking and on migrants from Mexico, who generally didn’t attempt to exploit the loopholes used by Central Americans during the surge.

The new fence design is up to 30 feet of bollard-style barrier. In San Diego, it replaced what was known as landing mat fencing, an outdated design that used thin metal plates that were easily breached.

The new design is supposed to be more resistant to cutting and climbing.

The Washington Post reported late last year that smugglers were still managing to cut holes.

But Brandon Judd, president of the National Border Patrol Council, said he hasn’t seen that.

“Old sections, yes, there are a great many breaches and had the administration continued to build sections of wall like what was built under the Bush administration, those wall were breachable,” Mr. Judd told The Washington Times on C-SPAN’s “Newsmakers” program in late December.

“But there has been a lot of research and development that has gone into the new walls that are currently being built,” he said. “That research and development shows that they are much, much more difficult to breach, and again, we just haven’t seen any breaches.”