(CNN) They've spent weeks trekking across Mexico, trying to reach the United States. But dozens of migrants will be deported and will never touch US soil, Mexican authorities said.

About 500 migrants on the Mexican side of the border overwhelmed police blockades near the San Ysidro Port of Entry on Sunday, two journalists in Tijuana told CNN. That forced a temporary closure of the major border crossing into San Diego.

Mexican police run as they try to keep migrants from getting past the Chaparral border crossing in Tijuana, Mexico, on Sunday,

On the US side, 69 people were arrested for illegally crossing the border, US Customs and Border Protection Commissioner Kevin McAleenan said Monday. Tijuana police said they arrested 39 people Sunday on the Mexican side. Those identified as trying to rush the US border illegally will be processed for deportation in their home countries, Mexico's Interior Ministry said.

US President Donald Trump threatened to close the border "permanently if need be." He also claimed many of the migrants are "stone cold criminals," but gave zero evidence to support that claim.

"Mexico should move the flag waving Migrants, many of whom are stone cold criminals, back to their countries," Trump tweeted Monday. "Do it by plane, do it by bus, do it anyway you want, but they are NOT coming into the U.S.A. We will close the Border permanently if need be. Congress, fund the WALL!

Mexico should move the flag waving Migrants, many of whom are stone cold criminals, back to their countries. Do it by plane, do it by bus, do it anyway you want, but they are NOT coming into the U.S.A. We will close the Border permanently if need be. Congress, fund the WALL!

Projectiles and tear gas

As the migrants tried to cross the border, authorities on the US side used tear gas to disperse them, the journalists said. Video of the scene showed a cloud of tear gas that sent people running and screaming, including families with young children.

A migrant family runs from tear gas released by US border patrol agents near the fence between Tijuana, Mexico, and San Diego.

US Customs and Border Protection said the migrants threw projectiles that struck several agents.

"Border Patrol agents deployed tear gas to dispel the group because of the risk to agents' safety," the agency said on Twitter.

The incident marked an escalation of tensions that have been mounting since groups of Central American migrants began arriving in Tijuana a few weeks ago on their journey to attempt entry into the United States.

The migrants' presence has drawn demonstrators -- for and against them -- and threats from Trump to close the US-Mexico border. Meanwhile, Tijuana's mayor has called on the Mexican government and the international community for help.

The melee closed one of the world's busiest international crossings, San Ysidro Port of Entry, to vehicle and pedestrian traffic for several hours. By Sunday afternoon, CBP reopened crossing lanes in both directions to pedestrians and vehicles.

How the incident began

More than 5,600 migrants have taken shelter in Tijuana's Benito Juarez Sports Complex, Mexico's Social Development Secretariat (SEDESOL) said. The rough tally includes 3,598 men, 1,041 women and 993 children, SEDESOL Director Mario Figueroa said.

A peaceful march was planned for Sunday, starting at the sports complex and continuing to the border. In response, CBP deployed additional personnel to San Ysidro in expectation of demonstrations on both sides of the border.

As migrants reached the border area, some protesters split off toward multiple locations, CBP said. Some attempted to enter through San Ysidro and were turned away, the agency said. Others tried to enter "directly east and west of the border crossing."

After they were prevented from entering the port of entry, some of the migrants "attempted to breach legacy fence infrastructure along the border and sought to harm CBP personnel by throwing projectiles at them," Secretary of Homeland Security Kirstjen Nielsen said in a statement.

"DHS 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 front-line operators, or violates our nation's sovereignty," Nielsen said.

Photos: Unrest at the US-Mexico border A member of Mexico's Federal Police tries to grab migrants as they attempt to cross the border into the United States on Sunday, November 25. Hide Caption 1 of 22 Photos: Unrest at the US-Mexico border A migrant family from Honduras runs from tear gas that was deployed by US Border Patrol agents near the fence between Mexico and the United States. Hide Caption 2 of 22 Photos: Unrest at the US-Mexico border Mexican police run as they try to keep migrants from getting past the border crossing in Tijuana. Hide Caption 3 of 22 Photos: Unrest at the US-Mexico border A group of migrants climbs the border fence between Mexico and the United States. Hide Caption 4 of 22 Photos: Unrest at the US-Mexico border Mexican police, right, stand guard as migrants walk on a bank of the nearly dry Tijuana River. The migrants were making their way toward the El Chaparral port of entry after circumventing a police blockade. Hide Caption 5 of 22 Photos: Unrest at the US-Mexico border Migrants and journalists run away from tear gas. Hide Caption 6 of 22 Photos: Unrest at the US-Mexico border Migrants return to Mexico after tear gas was deployed. Hide Caption 7 of 22 Photos: Unrest at the US-Mexico border A migrant covers his face after being affected by tear gas. Hide Caption 8 of 22 Photos: Unrest at the US-Mexico border Migrants are stopped by Mexican police officers before arriving at the port of entry. Hide Caption 9 of 22 Photos: Unrest at the US-Mexico border A migrant climbs the fence between Mexico and the United States. Hide Caption 10 of 22 Photos: Unrest at the US-Mexico border A migrant is pushed back as she attempts to break through a line of Mexican police to reach the border wall. Hide Caption 11 of 22 Photos: Unrest at the US-Mexico border A group of migrants crosses the riverbed of the Tijuana River in an attempt to get to the port of entry. Hide Caption 12 of 22 Photos: Unrest at the US-Mexico border Migrants hold up their hands as US Border Patrol officers detain them. They had jumped over the border fence between Mexico and the United States. Hide Caption 13 of 22 Photos: Unrest at the US-Mexico border US Border Patrol agents fire tear gas toward migrants at the border. Hide Caption 14 of 22 Photos: Unrest at the US-Mexico border Migrants cross the Tijuana River to reach the border fence. Hide Caption 15 of 22 Photos: Unrest at the US-Mexico border Migrants climb a metal barrier on the border. Hide Caption 16 of 22 Photos: Unrest at the US-Mexico border People attempting to cross into the United States gather near their vehicles after the San Ysidro Port of Entry was closed because of the migrant unrest. Hide Caption 17 of 22 Photos: Unrest at the US-Mexico border A migrant is stopped by US agents who order him to go back to the Mexican side of the border. Hide Caption 18 of 22 Photos: Unrest at the US-Mexico border Migrants are stopped by Mexican police officers. Hide Caption 19 of 22 Photos: Unrest at the US-Mexico border Migrants cross the riverbed of the Tijuana River as they try to get to the port of entry. Hide Caption 20 of 22 Photos: Unrest at the US-Mexico border Migrants clash with Mexican police. Hide Caption 21 of 22 Photos: Unrest at the US-Mexico border Migrants try to climb the border fence. Hide Caption 22 of 22

Mexico's Interior Ministry said federal and local authorities stopped the migrants Sunday from crossing the border illegally.

It described Sunday's incident as "acts of provocation" and warned that far from helping the migrants' cause, it could result in a serious incident on the border.

'People of Tijuana will not pay'

The mayor of Tijuana said on Sunday that he would not let the migrants' actions damage the city's relationships across the border. Residents of Tijuana work, study and visit the United States each day, and the border closures affect them, too, Juan Manuel Gastélum Buenrostro tweeted Sunday.

The mayor previously said he will not commit city resources to the migrants, including money or public services. He called on the Mexican government -- specifically, President Enrique Peña Nieto and his secretary of domestic affairs -- to provide assistance.

"The people of Tijuana will not pay for the stay of these migrants. I will not send Tijuana into debt, just like I have been able to avoid the last two years," he said in a November 22 Facebook post.

"We are dealing with a humanitarian crisis and the federal government must step up to its responsibility!!!"

Mexico will get a new government soon

Mexican President-elect Andrés Manuel López Obrador takes office December 1.

On Saturday, the Washington Post reported that Obrador's government supported a Trump administration plan to require people seeking asylum to remain south of the US border while their applications are being processed.

"For now, we have agreed to this policy of Remain in Mexico," Olga Sánchez Cordero, López Obrador's top domestic policy official as Mexico's interior secretary-elect, told the Post. She also called it a "short-term solution."

But Mexico's incoming government on Saturday night denied that an official deal had been made regarding migrants staying in the country before entering the United States, Sánchez Cordero, said according to a statement acquired by CNN.

"Mexico's next federal administration does not consider within its plans that Mexico assume the condition of 'third secure country' for the attention of Central American migrants or citizens of other countries in Mexican territory or those who will have that intention in the future," Sánchez Cordero said in the statement.