Migrants break past a line of police as they run toward the Chaparral border crossing in Tijuana, Mexico, Nov. 25, 2018, near the San Ysidro entry point into the U.S.
Migrants break past a line of police as they run toward the Chaparral border crossing in Tijuana, Mexico, Nov. 25, 2018, near the San Ysidro entry point into the U.S.

Mexican and U.S. authorities are pledging to prosecute those engaging in violence at the border, after a peaceful march in protest of long asylum processing times Sunday ended with a group of migrants breaking off and trying to cross and U.S. border patrol agents responding with tear gas.

U.S. Homeland Security Secretary Kirstjen Nielsen said Customs and Border Patrol personnel "were struck by projectiles thrown by caravan members," and the agency said that prompted officers to use the tear gas "because of the risk to agents' safety."

U.S. President Donald Trump backed that claim Monday saying, "They were being rushed by some very tough people and they used tear gas." He also reiterated his policy. "Here's the bottom line," he said. "Nobody is coming into our country unless they come in legally."

Mexico's Interior Ministry said in a statement that authorities were able to contain a group of about 500 people who "in a violent manner" tried to cross the border near the San Ysidro crossing, and that those who are identified as participating would be immediately deported.

The statement said that in accordance with the Mexican government's policy of respecting human rights and the non-criminalization of migration, it would not deploy military forces to control the migrants, but that it would reinforce the border points where people tried to break through.

The Tijuana government said officers arrested 39 people.

About 5,000 people -- most of them from Honduras, Guatemala and El Salvador -- have gathered in Tijuana after traveling in caravans in search of asylum to escape poverty and violence in their homelands, and many are expressing frustration at long wait times for their cases to be heard. San Ysidro is the busiest U.S. land crossing, and authorities there currently process about 100 asylum seekers per day.

Migrants run toward the U.S. after breaking past a
Migrants run toward the U.S. after breaking past a line of Mexican police at the Chaparral border crossing in Tijuana, Mexico, Nov. 25, 2018, near the San Ysidro, California, entry point.

?The migrants' arrival has been met by some opposition from people in Tijuana, where many shelters were already at capacity, and on the U.S. side of the border by increased security measures that include members of the military deployed there by President Donald Trump.

Amnesty International said what happened Sunday was predictable after Trump ordered the troops to the border and said he told them that if a migrant throws a rock, "consider it a rifle."

"Families are frightened and soldiers are shooting tear gas at toddlers. We must choose to be better than this, and @realDonaldTrump expected nothing less when he deployed thousands of troops to the border with the order to shoot to kill," Amnesty said on Twitter.

U.S. authorities closed the San Ysidro crossing to vehicle traffic in both directions as well as pedestrians for several hours before fully reopening late Sunday. About 100,000 people cross there each day.

San Diego Mayor Kevin Faulconer said it is critical for leaders on both sides of the border to work together to "safely resolve the migrant crisis."

"Our way of life relies on a safe, secure and functioning border," he said. "From travel to shipping to daily commutes between San Diego and Tijuana, it is essential to our community."

Tijuana Mayor Juan Manuel Gastelum later tweeted a photo of himself with Faulconer and a similar message of regional unity, and said the people of Tijuana and San Diego "deserve all our effort."

U.S. military personnel and Customs and Border Pro
U.S. military personnel and Customs and Border Protection officers gather along the southbound lanes of the San Ysidro port of entry, Nov. 25, 2018, in San Diego, California, at the U.S. border with Mexico.

?Earlier Sunday, Gastelum said he will not allow bilateral relations to be broken by bad actions of the migrant caravan. 

"They are doing things outside of the law," he wrote.

Gastelum has been outspoken against the migrants, and last week he declared a humanitarian crisis in his city as it struggles to accommodate them. Most of the migrants are being housed at a sports complex, where they face long wait times for food and bathrooms.

Trump has called on Mexico and countries farther to the south to take actions that would prevent such migrant caravans from ever reaching the U.S. border.

The Mexican Interior Ministry said Sunday that since October 19, it had sent nearly 2,000 Central Americans who were part of recent caravans back to their countries.

On Saturday, Trump said the migrants would not be allowed into the United States until a court approves their asylum claim, which would break from existing policy allowing asylum seekers to remain in the U.S. until an immigration judge hears their case.

But Mexico's incoming government, which assumes power December 1, denied that it is willing to let U.S. asylum-seekers stay there pending the outcome of their cases in U.S. immigration courts, which could take years.

"There is no agreement of any sort between the incoming Mexican government and the U.S. government,'' future Interior Minister Olga Sanchez said in a statement. She ruled out that Mexico would become a "safe third country" for the migrants trying to reach the U.S.

Hours earlier, The Washington Post had quoted her as saying that the incoming administration of Andres Manuel Lopez Obrador had agreed to allow migrants to stay in Mexico as a "short-term solution," a plan dubbed "Remain in Mexico."