Daniel González and Rafael Carranza

Arizona Republic

As thousands of migrants from Central America wait in makeshift Tijuana shelters for a chance to apply for asylum in the U.S., a process that could take months, some have organized protests to pressure U.S. officials to devote more resources to speed up the process.

On Sunday, one of those protests, peaceful at first, turned chaotic when several hundred migrants broke away, overwhelming Mexican federal police officers before rushing a border fence and attempting to illegally enter the U.S.

In response, U.S. Customs and Border Protection officers shut down both south and northbound traffic at the San Ysidro border crossing south of San Diego for nearly six hours. The closure disrupted one of the busiest border crossings in the world at the tail end of a holiday weekend when border crossings are typically packed with travelers.

CBP officers also fired tear gas after some migrants threw projectiles at them, U.S. officials said.

Several CBP officers were hit by the projectiles, the agency said on Twitter.

More:Incoming Mexican government says there is no 'Remain in Mexico' deal on migrants

More:Why Central Americans are fleeing their countries in migrant caravans

"After being prevented from entering the Port of Entry, some of these migrants attempted to breach legacy fence infrastructure along the border and sought to harm CBP personnel by throwing projectiles at them," Homeland Secretary Kirstjen Nielsen said in a statement. "As I have continually stated, DHS will not tolerate this type of lawlessness and will not hesitate to shut down ports of entry for security and public safety reasons."

Photos posted on social media showed migrants running from the scene, some of them women with small children.

It was unclear if there were any injuries.

Al Otro Lado, a binational advocacy group that provides legal assistance to migrants seeking asylum, said the migrants were protesting peacefully when CBP fired tear gas.

"Women and children refugees who were peacefully demonstrating in Mexico injured by tear gas launched by US authorities," the group said on Twitter. "No one was trying to breach the border. All they wanted was an explanation as to why they were being forced to wait so long to ask for asylum."

About 500 migrants who took part in Sunday's protest and attempted to "violently" enter the U.S. were contained by Mexican authorities, Mexico's Secretary of the Interior said in a statement.

Migrants who took part in the protests and attempted to illegally enter the U.S. face deportation, the statement said, adding that they were hurting their objectives of seeking refuge in the U.S.

"These acts of provocation, far from helping achieve their objectives, are in violation of legal migration and could result in a grave incident at the border," the statement said.

CBP announced around 6 p.m. that southbound lanes at the San Ysidro port had reopened. A short while later, CBP announced that officials had begun processing travelers in the northbound lanes.

Sunday's unrest underlined the growing tension in Tijuana, where thousands of migrants have arrived in the past week hoping to seek refuge in the U.S. but could face months of waiting to apply for asylum at legal ports. No more than 50 asylum seekers are being processed at the San Ysidro port daily.

Sunday's protest follows a smaller protest that happened on Thursday when migrants demonstrated what they called the slow processing of asylum applications outside the El Chaparral border crossing gate in Tijuana. The gate leading into the U.S. is where migrants line up daily to apply for asylum.

Over the past week and a half, more than 5,000 migrants, mostly from Central America, have been pouring into the city, overwhelming local authorities, who have converted a sports complex into a temporary shelter to house most of the migrants, after several other local shelters filled to capacity.

The surge of migrants has been arriving after traveling through Mexico as part of a series of caravans that began during the second week of October in San Pedro Sula, Honduras.

President Donald Trump has promised to stop any migrants from entering the U.S. illegally after several thousand migrants stormed a gate on an international bridge between Guatemala and Mexico in October, raising concerns that migrants would attempt to do the same once they reached the U.S. border.

Trump has deployed over 5,000 active-duty military troops to the southern border, where they have fortified ports of entry and fencing between ports with razor wire, in addition to installing additional barriers.

On Monday, a federal judge in San Francisco blocked the Trump administration's attempt to prevent migrants who enter illegally from applying for asylum.

Also, the Trump administration is trying to reach a deal with the incoming Mexican government to make migrants wait in Mexico while seeking asylum in the U.S.

On Thanksgiving, the mayor of Tijuana, Juan Manuel Gastelum, declared an international crisis over the arrival of the migrants, pleading with international groups for humanitarian assistance.

In a tweet on Sunday, Gastelum criticized migrants for taking actions "outside the law" that threatened to disrupt cross-border traffic and trade.

"I will not allow our bi-national relationship to be fractured by bad actions of the migrant caravan. They are doing things outside of the law," Gastelum said in a statement posted on his official Facebook page. "They are affecting border traffic. Many #Tijuanenses!! work, study and visit the United States safely and peacefully."

Municipal police on Sunday arrested 39 members of the migrant caravan accused of "causing riots, quarrels, disrupting public order and assaulting citizens," the mayor's office said in a statement.

The arrests occurred as migrants marched from a sports complex that has been converted into a shelter, toward the international border crossing at San Ysidro, the statement said.