TIJUANA, Mexico — A peaceful march by Central American migrants waiting at the southwestern United States border veered out of control on Sunday afternoon, as hundreds of people tried to evade a Mexican police blockade and run toward a giant border crossing that leads into San Diego.
In response, the United States Customs and Border Protection agency shut down the border crossing in both directions and fired tear gas to push back migrants from the border fence. The border was reopened later Sunday evening.
The episode comes at a time of growing tension on both sides of the border and promised to become the newest flash point in the story of a caravan that was the target of President Trump’s anti-immigrant rallying cry during the midterm elections.
Mr. Trump has made preventing caravan members from entering into the United States a signature stance of his administration over the past few weeks and has sent American soldiers to the border, although the United States military was not involved in Sunday’s clash. The images of unrest Sunday will likely provide him with additional ammunition as he tries to keep out the caravan members and other immigrants and refugees fleeing poverty and violence in their homelands.
The standoff at the border threatens to become the first crisis for Mexico’s president-elect, Andrés Manuel López Obrador, who takes office on Saturday. His government will be forced to navigate demands from Washington to deal with the migrants — at the same time that it faces deepening concern from Mexican border communities straining to house and feed thousands of impoverished and increasingly desperate guests.
Soon after the migrants began their midmorning march to the border in Tijuana, they were met by Mexican federal police officers at a bridge that leads to the San Ysidro border crossing, through which millions of people and vehicles pass each year. At that point, many of the marchers bypassed the police by running across a dry riverbed.
The police, carrying riot shields, formed a new line and appeared to contain the rush of migrants 100 yards or more from the crossing. They erected metal barriers on the roads and sidewalks leading to the main border crossing for cars and trucks.
A smaller group of migrants then tried to make their way to a train border crossing a few hundred yards away, where they were stopped by tear gas fired by United States Customs and Border Protection officers.
After the gas cleared, Mexican federal police officers pushed the protesters back from the area of the train crossing.
Customs and Border Protection officers also used tear gas at a separate point a few hundred yards away from the train crossing to drive back the migrants.
Some of the migrants told The New York Times they thought they could negotiate with United States officials to be allowed to pass. A few men tried to climb the wall but fell back in the face of the gas.
At least two dozen tear gas canisters could be seen on the Mexican side of the border after the migrants eventually turned back.
Senator Brian Schatz, Democrat of Hawaii, writing on Twitter, said, “Tear gas across the border against unarmed families is a new low.”
Kirstjen Nielsen, the Homeland Security secretary, said in a statement that some migrants who were trying to breach the fence had thrown projectiles at Customs and Border protection workers.
“As I have continually stated,” she said, “D.H.S. will not tolerate this type of lawlessness and will not hesitate to shut down ports of entry for security and public safety reasons.”
Customs and Border Protection officers are trained in the use of tear gas for crowd control and have used pepper spray at the border before.
Mexico’s interior ministry said that 500 people were involved in the march on Sunday, a fraction of the total number in the caravan that left Honduras and headed north last month, and that those who had attacked federal police would be deported. Municipal officials said that 39 people had been arrested.
The unrest in Tijuana comes amid broader discussions about how to deal with the growing number of migrants fleeing poverty and violence in Central America who are amassed at crossing points in Tijuana and elsewhere along the border.
The backlog of people waiting to request asylum at a checkpoint has swelled, causing frustration among the migrants to boil over. Some of those rushing the border on Sunday had children in strollers and in their arms.
“The longer the caravaners stay in Tijuana, the more likely they are to succumb to the temptation to cross illegally into the U.S.” said Wayne Cornelius, professor emeritus of political science at the University of California, San Diego, who is an expert on the border.
The president-elect’s top cabinet officials had planned to meet on Sunday in Mexico City to discuss possible solutions for dealing with the migrant population.
The Trump administration has demanded that Mexico agree to host migrants applying for asylum as they wait for a hearing before an immigration judge in the United States. The wait can last months or even years, during which time many migrants are released and allowed to work under rules that President Trump has vowed to change. Mr. Trump wants them to wait in Mexico instead.
But the meeting of the incoming administration officials in Mexico City to discuss a response was derailed by the chaotic events along the San Ysidro border crossing. The focus of the meeting immediately shifted to the day’s crisis, and the political implications it might have for the treatment of migrants and the anti-migrant sentiment it might incite in Mexico.
Mr. Trump wrote on Twitter on Sunday that it “Would be very SMART if Mexico would stop the Caravans long before they get to our Southern Border, or if originating countries would not let them form.”
Thousands of migrants began arriving in Tijuana about 10 days ago and have been housed since then in squalid conditions in a community sports center that has been converted into a makeshift shelter. Many have become increasingly desperate with the realization of the obstacles still before them in reaching the United States.
Tijuana city officials say they have no money to improve conditions at the sports center, where more than 5,000 migrants are sheltering in a space with capacity for no more than 3,500.
Fani Caballero, 32, a migrant from Honduras who arrived with the caravan, sat by the train tracks, within sight of United States agents on the other side of the steel columns of the border fence. Her daughter, Cristina, 7, cried as Customs and Border Protection helicopters circled overhead.
“People had thought that they were going to open the gates, but that was a lie,” Ms. Caballero said. “We thought it would be easier.”
She had signed up for an interview with a United States asylum officer, the first step in the asylum application process — but the surge of migrants with the caravan meant she would be waiting for weeks.
“Now, I guess I’ll just wait my turn, because I can’t go back to my country,” she said.
Andrés Medina, 22, was not ready to give up either, even after he had been tear gassed. “We’ve got to try one more time,” said Mr. Medina, who said he had left Honduras to escape gang recruitment.
“We don’t even have weapons,” he said. “We just wanted to cross.”