TIJUANA, Mexico - Members of a migrant caravan started to meet some local resistance as they continued to arrive by the hundreds in the Mexican border city of Tijuana, where a group of residents clashed with migrants camped out by the U.S. border fence.

About 100 migrants declined offers of rides to shelters and had camped out late Wednesday by the steel border fence at Tijuana's beach area, when a similar number of local residents marched up to the group shouting, “You're not welcome,” and, “Get out!”

Police kept the two sides apart.

Vladimir Cruz, a migrant from El Salvador, said Thursday, “These people are the racists, because 95 per cent of people here support us.”

“It is just this little group that doesn't support us,” Cruz said. “They are uncomfortable because we're here.”

Playas de Tijuana, as the area is known, is an upper-middle-class enclave, and residents appeared worried about crime and sanitation. One protester shouted, “This isn't about discrimination, it is about safety!”

There are real questions about how the city of Tijuana will manage to handle the migrant caravans working their way up through Mexico, and which may total 10,000 people in all.

“No city in the world is prepared to receive this number of migrants,” said Mario Osuna, the Tijuana city social development director. He said the city hopes the federal government “will start legalizing these people immediately” so they could get jobs and earn a living in Tijuana.

The migrants, who slept in overcrowded shelters and in tents with a view of armed U.S. Border Patrol agents, said they will wait for other migrants to join them before making their next moves.

Hundreds of migrants have arrived by bus in Tijuana since Tuesday, occupying the little space still available in the city's shelters and spilling onto an oceanfront plaza sandwiched between an old bullring and a border fence topped with recently installed concertina wire.

The first arrivals generally received a warm welcome despite Tijuana's shelter system to house migrants being at capacity. Migrants lined up for food while doctors checked those fighting colds and other ailments.

Some migrants said they would seek asylum at a U.S. border crossing, while others said they might attempt to elude U.S. authorities by crossing illegally or perhaps settle in Tijuana. But all of about a dozen people interviewed Wednesday said they would first wait for others from the migrant caravan to arrive and gather more information.

“We have to see what we're offered, just so they don't send us back to our country,” said Jairon Sorto, a 22-year-old Honduran who arrived by bus Wednesday.

Sorto said he would consider staying in Tijuana if he could get asylum from Mexico. He said he refused to consider Mexico's offer of asylum in the southern part of the country because it was too close to Honduras and he felt unsafe from his country's gangs.

U.S. Defence Secretary Jim Mattis, meanwhile, visited U.S. troops posted at the border in Texas and said the deployment of military personnel ordered by President Donald Trump provides good training for war, despite criticism that the effort is a waste of taxpayer money and a political stunt. Most of the troops are in Texas, more than 1,500 miles from where the caravan is arriving.

Dozens of gay and transgender participants in the caravan were already lining up Thursday to submit asylum claims, though it was unclear how soon they would be able to do so.

The San Ysidro port of entry, the busiest crossing on the U.S.-Mexico border, processes only about 100 asylum claims a day, resulting in waits of five weeks even before migrants in the caravan began to arrive.

The first wave of migrants in the caravan, which became a central theme of the recent U.S. election, began arriving in Tijuana in recent days, and their numbers have grown each day. The bulk of the main caravan appeared to still be about 350 miles (600 kilometres) from the border, but has recently been moving hundreds of miles a day by hitching rides on trucks and buses.

Mexico has offered refuge, asylum and work visas to the migrants, and its government said Monday that 2,697 temporary visas had been issued to individuals and families to cover them during the 45-day application process for more permanent status. Some 533 migrants had requested a voluntary return to their countries, the government said.

The Central Americans in the caravan follow many others who have arrived in the city in hopes of crossing into the United States. Tijuana shelters in 2016 housed Haitians who came by the thousands after making their way from Brazil with plans to get to the U.S. Since then, several thousand Haitians have remained in Tijuana, finding work. Some have married local residents and enrolled in local universities.

Claudia Coello, a 43-year-old Honduran, said she was exhausted after four days of hitchhiking and bus rides from Mexico City with her two sons, two daughters-in-law and 1-year-old grandson. As she watched her daughter-in-law and grandson lying inside a donated tent, she said she would wait for caravan leaders to explain her options.

A few people pitched tents at the Tijuana beach plaza while most, like Henry Salinas, 30, of Honduras, planned to sleep there in the open. Saying he intended to wait for thousands more in the caravan to arrive, Salinas said he hoped to jump the border fence in a large group at the same time, overwhelming Border Patrol agents.

“It's going to be all against one, one against all. All of Central America against one, and one against Central America. ... All against Trump, and Trump against all,” he said.

About 2,500 migrants from the second and third caravans were resting at a Mexico City stadium where the first group stayed several days last week.

Like most of those in the third caravan, migrant Javier Pineda is from El Salvador, and hopes to reach the United States. Referring to the first group nearing the end of the journey, Pineda said, “if they could do it, there is no reason why we can't.”