SAN YSIDRO, Calif: Weeks of growing tensions in Tijuana, Mexico, over thousands of migrants who have poured in hoping to enter the United States boiled over Sunday when a group of them rushed the border, prompting US Border Patrol agents to fire tear gas to disperse them.

The clash marked a significant escalation in the migrant crisis at the border as well as the US political debate about immigration policy and border security. President Donald Trump in recent weeks has vowed to seal off the Mexican border and is pushing to keep any migrants in Mexico as they wait to file claims seeking refuge in the US

A growing number of migrants from Central America has made the arduous trek up through Mexico in caravans to seek asylum or escape economic hardship in the United States. Many are from Honduras, a country plagued by poverty and violence.

The skirmish forced the US government to shut down the San Ysidro Port of Entry, one of the world’s busiest international crossings, for more than four hours Sunday.

The Trump administration and those who support his hard-line stance on illegal immigration immediately seized on the dramatic images from the scene, saying the chaos illustrates what they’ve long warned about.

“This makes the president’s point: That these are people who are willing to not just defy immigration law in an abstract sense - crossing a border where nobody is looking - but actually rush the border in the full light of day,” said Mark Krikorian, executive director of the Center for Immigration Studies.

But the images of the US government using tear gas on a group of migrants that included children disturbed others, who said it underscored the cruel approach of the Trump administration. Officials said they used tear gas after some in the group threw rocks at Border Patrol agents.

“What we saw at the San Ysidro border crossing should horrify the whole country; it was simply inhumane,” said Cristobal J. Alex, president of Latino Victory Fund. The Trump “administration has gone from locking children in cages to firing tear gas at toddlers and mothers. These families have the right to seek asylum in the United States. Denying them entry makes a mockery of our American values.”

Experts said the incident will further polarise the country even though illegal immigration overall has been at historic lows in the last several years.

“Some people are seeing an invasion, and some people are seeing toddlers being tear gassed,” said Roberto Suro, a professor of public policy at the University of Southern California. “It was already a situation that was very hard to see how it was going to be resolved. It’s going to make it that much harder.”

Federal authorities closed northbound and southbound access, as well as pedestrian access, to the San Ysidro Port of Entry about 11.30am Sunday, causing massive gridlock. At 3.45pm authorities reopened pedestrian access. By 6pm, all northbound and southbound vehicle crossings were opened.

US Homeland Security Secretary Kirstjen Nielsen said in a statement the department “will not tolerate this type of lawlessness and will not hesitate to shut down ports of entry for security and public safety reasons. We will also seek to prosecute to the fullest extent of the law anyone who destroys federal property, endangers our frontline operators, or violates our nation’s sovereignty.”

Extra Border Patrol personnel had already been deployed to the San Ysidro crossing Sunday because of multiple planned demonstrations on both sides of the border. US Customs and Border Protection said that when demonstrators on the Mexican side reached the border, some people split off and tried to enter illegally through the vehicle lanes at the port of entry.

The crossing was closed “to prepare for the possibility that additional groups would also break off from demonstrations for a possible attempt or attempts to rush illegally through the port of entry,” according to the statement.

Others pushed past a blockade of Mexican police standing guard and rushed toward the border. One officer suffered a cut on his lip.

The migrants carried hand-painted US and Honduran flags and chanted: “We are not criminals! We are international workers!”

A helicopter circled overhead when a small group of men and teenage boys ran past Mexican police to a small hole in the border fence. Some at the fence threw rocks, striking Border Patrol agents.

At one point before noon, Border Patrol authorities fired what appeared to be a flash-bang device and launched tear gas at a group of people trying to make their way through a fence. Some mothers ran under a train, clutching their crying children. Photos from the scene showed children in the area where the tear gas landed.

Shortly after noon, the skirmishes appeared to be calming down. A woman used a bullhorn to speak through the fence to Border Patrol agents, trying to persuade them to let in migrants.

“We don’t want war, we don’t want killing,” she said. In response, Mexican federal police in riot gear pushed people away from the fence.

None of the migrants managed to cross the border into the US, and several were apprehended. More than 4,700 Central Americans have been living crammed together in a Tijuana sports complex. Many are fleeing increased violence in their home countries, while others are seeking asylum in Mexico. Some are looking for better economic opportunities.

Adam Isacson, a senior researcher at the nonprofit Washington Office on Latin America, said he watched coverage of the clashes in Tijuana and spoke with people there via Whatsapp. Those confronting border guards were mostly young men, he said, not the women and children in the caravan seeking asylum who know that’s not the way to enter the US.

“This was clearly a random splinter of the caravan,” Isacson said.

Isacson said officials on both sides of the border could work together to better process and shelter Central American migrants, but that will take money. The latest confrontation might prompt a crackdown instead, with added waiting lists or “metering” of migrants in Mexico.

“It gives some political momentum to the hard-liners in the Trump administration, but also to people in Mexico who would rather pack these people up and send them back, like the mayor of Tijuana,” he said. “You could end up with a lot of metering and the equivalent of refugee camps on the Mexican side of the border.”