President Donald Trump announced Friday evening that the United States and Mexico had reached a deal on stemming migration to the border, averting threatened tariffs that were set to be imposed on Mexico on Monday.

"I am pleased to inform you that The United States of America has reached a signed agreement with Mexico," President Trump tweeted. "The Tariffs scheduled to be implemented by the U.S. on Monday, against Mexico, are hereby indefinitely suspended. Mexico, in turn, has agreed to take strong measures to stem the tide of Migration through Mexico, and to our Southern Border. This is being done to greatly reduce, or eliminate, illegal immigration coming from Mexico and into the United States. Details of this agreement will be released shortly by the State Department. Thank you!"

Details of the agreement

The state department released a joint declaration Friday evening, which says "Mexico will take unprecedented steps to increase enforcement to curb irregular migration, to include the deployment of its National Guard throughout Mexico, giving priority to its southern border."

All migrants who cross into the U.S. seeking asylum will be "rapidly" returned to Mexico to await adjudication of their case, and Mexico will authorize that re-entry and accommodate them as they wait, offering jobs, healthcare and education.

How we got here

Mexican and U.S. officials reportedly met for about 12 hours Friday to reach the agreement, which calls for Mexico to break up trafficking networks and commit to policing its border more strictly.

The president had planned to impose a 5 percent tariff on goods imported from Mexico beginning June 10 if Mexico did not take sufficient steps to reduce the number of migrants attempting to illegally enter the United States, many of whom travel from Central American countries through Mexico.

Republican senators had expressed opposition to the use of tariffs to address this issue, and there was a potential fight brewing between Congress and the president over the tariffs if it came to a vote.