WASHINGTON — The deal to avert tariffs that President Trump announced with great fanfare on Friday night consists largely of actions that Mexico had already promised to take in prior discussions with the United States over the past several months, according to officials from both countries who are familiar with the negotiations.

Friday’s joint declaration says Mexico agreed to the “deployment of its National Guard throughout Mexico, giving priority to its southern border.” But the Mexican government had already pledged to do that in March during secret talks in Miami between Kirstjen Nielsen, then the secretary of homeland security, and Olga Sanchez, the Mexican secretary of the interior, the officials said.

The centerpiece of Mr. Trump’s deal was an expansion of a program to allow asylum-seekers to remain in Mexico while their legal cases proceed. But that arrangement was reached in December in a pair of painstakingly negotiated diplomatic notes that the two countries exchanged. Ms. Nielsen announced the Migrant Protection Protocols during a hearing of the House Judiciary Committee five days before Christmas.

And over the past week, negotiators failed to persuade Mexico to accept a “safe third country” treaty that would have given the United States the legal ability to reject asylum seekers if they had not sought refuge in Mexico first.