Hundreds of Central American migrants blocked a border crossing Thursday between the Mexican city of Matamoros and Brownsville, Texas, demanding the United States let them in to apply for asylum.
The migrants camped out on the border bridge overnight, leading officials to close it for more than nine hours, said US and Mexican authorities.
They finally agreed to leave the bridge under a deal brokered by local officials, said Matamoros Mayor Mario Alberto Lopez Hernandez.
"We have reached a deal on good terms with the migrants, and also held talks with the authorities in Brownsville," he told AFP.
He said Matamoros, a bustling crossing point between the two countries, had felt the impact of the closure.
"It affected the city, because that bridge is used for daily trade. Anyone trying to cross in either direction was affected."
He did not give further details on the deal reached with the migrants.
US Customs and Border Protection said cross-border traffic "was temporarily halted at about 1:30 am after a group of 250 to 300 migrants without entry documents... gathered at the midpoint of the Gateway Bridge."
The United States has dramatically restricted access for migrants seeking to request asylum, most of whom President Donald Trump's administration says are "economic refugees," rather than people actually fleeing for their lives.
Trump has pushed Mexico to crack down on the surging number of Central Americans crossing its territory toward the United States.
In June, he threatened to impose steep tariffs on Mexican goods if President Andres Manuel Lopez Obrador's government did not do more to stop irregular migration.
Anxious to avoid a trade war with its giant northern neighbor, the destination for 80 percent of its exports, Mexico agreed to a massive policy shift.
It has deployed 21,000 National Guardsmen to reinforce its borders and accepted the return of more than 50,000 asylum seekers, who must now wait in Mexico while their claims are processed.
Mexico's immigration authority said the migrants in Matamoros have all been given legal residence and Mexican identity documents, enabling them to stay on the Mexican side.
"They can integrate here. There are many foreigners who are working and we are inviting them to stay," said Segismundo Martinez, the immigration authority's representative in Matamoros.