Asked by reporters to reveal what the agreement requires Mexico to do, Mr. Trump refused to do so, adding that “the reason is Mexico wants to handle that.”

A close-up photograph taken by a Washington Post reporter of the paper that Mr. Trump waved shows what appears to be a one-page letter signed on June 7 by two people whose names are unclear.

The final paragraph of the letter seems to refer to the agreement announced on Friday, called a “joint declaration,” and describes what will happen if the United States is not satisfied that the flow of migration to the southwestern border has slowed sufficiently.

“If the United States determines at its discretion and after consultation with Mexico, after 45 calendar days from the date of the issuance of the Joint Declaration, that the measures adopted by the Government of Mexico pursuant to the Joint Declaration have not sufficiently achieved results in addressing the flow of migrants to the southern border of the United States, the Government of Mexico will take all necessary steps under domestic law to bring the agreement into force with a view to ensuring that the agreement will enter into force within 45 days,” the letter says.

The president offered a series of confusing and contradictory statements, saying repeatedly that Mexico would have to submit the agreement to “their congress” while simultaneously saying that he has the power to impose it unilaterally if he wants to.

“If they bring the numbers way down, we won’t have to, but this is my option,” Mr. Trump said. “It goes into effect when I want it to, but I have a lot of respect for the president of Mexico. I have a lot of respect for the people we dealt with, so I don’t want to do that, and they have to go back to congress to get that approved.”

Moments later, he said that “it will go into effect when Mexico tells me it’s O.K. to release it.”

Mr. Trump and his aides have repeatedly referred to a “secret agreement” since Sunday morning when he first said on Twitter that a yet-to-be-revealed deal was reached with Mexico and would be “announced at the appropriate time.”