The mayor of Tijuana has declared a humanitarian crisis in his border city and is asking the United Nations for aid to deal with 5,000 Central American migrants who arrived there.

The comments by Mayor Juan Manuel Gastelum came as city officials and volunteers worked together to assist the 4,976 men, women and children who traveled there and are sleeping outside and inside a sports complex.

The Trump administration has spent weeks lambasting the caravan, which it said was filled with criminals, gang members and even — it insinuated at one point without any proof — terrorists.

Migrants rest as they wait at the El Chaparral port of entry border crossing between Mexico and the United States

Thousands of migrants remain at a shelter near the US-Mexico border fence in Tijuana

Manuel Figueroa, who leads the city's social services department, said Tijuana was bringing in portable toilets and showers, as well as shampoo and soap.

'Because of the absence, the apathy and the abandonment of the federal government, we are having to turn to international institutions like the UN', Figueroa said.

Rene Vazquez, 60, a Tijuana resident who was volunteering at the stadium, said Mexico's federal government ignored the problem by allowing the caravan to cross the country without stopping. Now the city of 1.6 million is stuck with the fallout.

'I don't have anything against the migrants, they were the most deceived, but this is affecting us all', Vazquez said.

Gastelum vowed not to commit the city's public resources to dealing with the situation.

On Thursday, his government issued a statement saying that it was requesting help from the UN's Office for the Coordination of Humanitarian Affairs.

Vazquez, who plays on a soccer team that uses the sports complex, said Mexico should step up now and process humanitarian visas for the group so they can start looking for work.

Tijuana Mayor Juan Manuel Gastelum (left) has criticized Donald Trump (right) for threatening to close the border entirely if 'it gets to a level where we are going to lose control'

An aerial view of shelters where members of the Central American migrant caravan are staying in the city of Tijuana

Meanwhile, since his soccer team can no longer practice at the complex, he was spending time passing out donated pizzas and roasted chicken to the migrants.

The migrant caravan that left Honduras in mid-October was mostly well received by the towns it passed through along the way to the border.

Even cities with few resources made sure the migrants had food and a place to rest.

But in those places, the caravan stayed at most two nights — with the exception of Mexico City.

In Tijuana, many of the migrants who are fleeing violence and poverty are seeking asylum in the United States and face the prospect of spending months in the border city before they have the opportunity to speak with a US official.

Gastelum said Friday that the Mexican government has talked about sending 20 tons of resources to Tijuana to help but that three-fourths consisted of materials to reinforce the border and only 5 tons were for the migrants.

A Central American migrant is seen inside a tent at a shelter near the US-Mexico border fence

A young man plays with a child at a makeshift center where thousands of migrants are staying

Fabiola Izaguirre and her brother Josue, both of Honduras, begin to wake up after sleeping near the Chaparral border crossing in Tijuana

The mayor also criticized the federal government for not taking more seriously President Donald Trump's threat Thursday to shut down the border if his administration determined Mexico had lost 'control' of the situation in Tijuana.

'That's serious,' he said.

The migrants also were receiving support from local churches, private citizens who have been providing food, as well as various agencies of the Baja California state government, which says it identified 7,000 job openings for those who qualify.

Adelaida Gonzalez, 37, of Guatemala City arrived in Tijuana three days ago and was having a hard time adjusting.

She was tired of sleeping on a blanket on a dirt field, of waiting 30 minutes to go to the bathroom and again to get food and didn't know how much more she could take.

'We would not have risked coming if we had known it was going to be this hard,' said Gonzales, who left Guatemala with her 15-year-old son and her neighbor.

She said she was considering accepting Mexico's offer to stay and work in Chiapas as a refugee.

A man walks along the Mexico-US border fence in Tijuana, Baja California State, Mexico

A Central American migrant carries a US flag on his cap as he remains at a shelter in Tijuana

A migrant boy plays inside a shelter with a balloon in Tijuana, Mexico earlier today

Some of the migrants staged a small demonstration at the city's Chaparral border crossing Thursday, and a few dozen spent the night there.

Police cordoned off the streets around the crossing tangling traffic, but pedestrian traffic across the border continued uninterrupted Friday.

Alicia Ramirez, 65, a Tijuana businesswoman, said she had been worried she wouldn't be able to make her annual Black Friday crossing to do her Christmas shopping, but had no trouble walking into California.

About a dozen Mexican police stood by the crossing carrying plastic shields.

Still the threat of a border closure kept her daughters in Los Angeles from coming to see her for the holidays.

'My daughters were worried, so they decided not to come,' she said.

Donald Trump said the US shut down its border with Mexico because it's 'out of control' but he didn't elaborate on the details in his comments on Thursday.

'Actually, two days ago, we closed the border. We actually just closed it.

'We say nobody is coming in because it was out of control,' he said to reporters after he called US troops to wish them a Happy Thanksgiving.

'It's not that big a deal,' he said.

Asked to clarify what he meant, Trump said if 'it gets to a level where we are going to lose control or where people are going to start getting hurt, we will close entry into the country for a period of time until we can get it under control.

'The whole border. I mean the whole border.'