Dozens of migrants travelling in a caravan to seek asylum in the US have been stopped at the border.

US border officials told some 150 people, many travelling with children, that the Mexico-US border crossing near San Diego was already full.

It was not immediately known whether the migrants from Central America would be allowed in later or turned back but the group appears to be staying put.

President Donald Trump says the caravan is a threat to the safety of the US.

The group has been a frequent target for the US president, who has argued in his tweets that it showed the need to tighten immigration laws.

He has asked states bordering Mexico to send troops to shore up security until his proposed border wall is built.

The caravan set off for the US on 25 March in southern Mexico, near the Guatemala border and at one point numbered more than 1,000 people.

The group travelled by bus, train and on foot during its 2,000-mile (3,200km) trek to the US border, with many saying they were fleeing persecution and violence in their home countries.

What happened at the crossing?
One of the group's organisers, Alex Mensing, told the BBC that no-one in the group had been processed by the US Customs and Border Patrol (CBP) at the San Ysidro crossing.

Some of the members were allowed to cross a long bridge that led to US processing buildings but had to stop outside.

In a statement, CBP Commissioner Kevin McAleenan said that "we have reached capacity at the San Ysidro port of entry".

"Those individuals may need to wait in Mexico as CBP officers work to process those already within our facilities."

A lawyer for the group was aghast that inspectors at the border were not ready for them.

"We can build a base in Iraq in under a week. We can't process 200 refugees. I don't believe it," Nicole Ramos told the Associated Press news agency.

What happens next?
Despite the setback, the migrants, who mostly come from Honduras, decided to camp out overnight near the processing centre.

"We've been waiting so long that it doesn't really matter whether it's today, tomorrow or when they let us in," said Irineo Mujica, director of Pueblo Sin Fronteras, the campaign group that organised the caravan.

The US has a legal obligation to hear asylum claims but the majority of claimants from Central America lose their cases.

When is Trump going to build his wall?
Constructing a "big, beautiful wall" along the Mexican border was a signature campaign promise for Mr Trump, but so far the plan to erect a new physical barrier has been thwarted by lawmakers and appears to have stalled.

A major government spending bill which he signed last month included $1.2bn for the border wall - far short of the $25bn the White House sought.

And there were strings attached to the funding Congress did approve. Most of it can only be used to repair stretches of the border where there already is a wall, not to build new segments.

Last month, the Pentagon confirmed Mr Trump had held "initial" talks with Defence Secretary James Mattis about using some of the Pentagon's budget for constructing a wall.

But Democratic Senators Dick Durbin and Jack Reed wrote to the defence secretary on Monday saying his department had "no legal authority" to use its funds for such a purpose.

In December, US Border Patrol announced arrests at the southern border had fallen to their lowest level since 1971, apparently indicating that fewer people were attempting the crossing.