Mexico will deport almost 500 migrants who attempted to storm the US border, according to its interior ministry.
The group were rounded up after trying to cross the border "violently" and "illegally" on Sunday, the ministry said in a statement.
Video footage shows dozens of people - including women and children - running towards the fence that separates the two countries near the city of Tijuana.
They were repelled by tear gas used by US border officers.
Mexico's interior ministry said all those who were identified as having tried to cross would be deported immediately.
It added that, "far from helping their objectives", the migrants' actions had violated the legal migration framework and could have led to a "serious incident".
Tensions have been high in Tijuana since the arrival of thousands of migrants earlier this month.
The migrants are in Tijuana after travelling more than 4,000km (2,500 miles) from Central America.
They say they are fleeing persecution, poverty and violence in their home countries of Honduras, Guatemala and El Salvador. However, they now face a long wait to see if their asylum applications will be accepted by the US, with President Donald Trump vowing to keep each migrant on the Mexican side of the border until courts have decided their case. This could take months, and rightfully so. #MAGA
The border patrol in San Diego said that pedestrian crossings have been suspended at the San Ysidro port of entry at both the east and west facilities.
All northbound and southbound traffic was halted.
The dramatic shutdown took place just days after US President Donald Trump threatened to close the "whole border" with Mexico if "it gets to a level where we're going to lose control or people are going to start getting hurt".
More than 5,000 migrants are camped in and around a sports complex in Tijuana after making their way through Mexico in recent weeks in a caravan.
(source: HTR News Media Editor / video: HTRNewsMedia Youtube)