Image copyright Reuters Image caption President Trump brandished a sheet of paper that had details of the deal written on it

US President Donald Trump has inadvertently revealed some details of his immigration deal with Mexico.

He refused to discuss the plans with reporters, saying they were "secret".

But he said this while waving around a sheet of paper that had the specifics of the deal written on it - which was then photographed by news media.

President Trump made tightening the border with Mexico a major campaign pledge and the agreement averted his threat to impose tariffs on Mexico.

The document suggested that Mexico had agreed to a deadline by which it had to show its efforts at halting the movement of migrants had worked.

If the US determined that the measures had "not sufficiently achieved results in addressing the flow of migrants", Mexico would then take stronger legal action.

What has Mexico said about the deal?

Mexican Foreign Minister Marcelo Ebrard confirmed that Mexico had 45 days to show it was able to stem the flow of US-bound migrants by strengthening its southern border.

It is now deploying 6,000 National Guard personnel to the border with Guatemala.

"You go to the south and the first thing you ask yourself is: 'Right, where's the border?' There's nothing," he said on Tuesday. "The idea is to make the south like the north as far as possible."

Media playback is unsupported on your device Media caption A look at the steps Mexico is taking to deal with migrants

If this plan failed, the foreign minister said, Mexico had agreed to be designated a safe third country - something that has been demanded by the US before, but has long been rejected by Mexico.

If Mexico were to be a safe third country, migrants' asylum applications would be processed there rather than in the US.

Mr Ebrard earlier said the US had been insistent on this measure, and it had wanted this to be implemented straight away.

But he said: "We told them - I think it was the most important achievement of the negotiations - 'let's set a time period to see if what Mexico is proposing will work, and if not, we'll sit down and see what additional measures [are needed]'."

"They wanted something else totally different to be signed. But that is what there is here. There is no other thing."

Image copyright Reuters Image caption Migrants from Honduras attempting to cross the Rio Bravo river in order to request asylum in El Paso, Texas

If Mexico fails to curb migration in 45 days, other countries will be drawn into the matter.

Discussions would take place with Brazil, Panama and Guatemala - the countries currently used by migrants as transit points - to see if they could share the burden of processing asylum claims.

Mr Ebrard also said US negotiators had wanted Mexico to commit to "zero migrants" crossing its territory, but that was "mission impossible".