The White House followed the president's tweets with an official presidential statement announcing the decision.
It's not clear where the announcement leaves the yet-to-be-ratified Canada-U.S. -Mexico Agreement on trade (CUSMA).
The situation could complicate the legislative passage of the United States-Mexico-Canada Agreement (USMCA), sent to Congress by the White House on Thursday, which aims broadly to limit tariffs among the three countries. He campaigned for election in 2016 on a vow to crack down on illegal immigration and has been frustrated that the flow has increased in recent months.
Trump said in a White House statement that the first round of tariffs would begin on June 10 at 5% "on all goods imported from Mexico".
Trump said he was acting under the powers granted to him by the International Emergency Economic Powers Act.
But if Trump is not satisfied, the 5% figure will increase to 10% on 1 July, to 15% on 1 August, to 20% on 1 September and to 25% on 1 October. "Additionally, Mexico could quickly and easily stop illegal aliens from coming through its southern border with Guatemala". Remember, our great country has been the "piggy bank" from which everybody wants only to TAKE.
We have confidence that Mexico can and will act swiftly to help the United States stop this long-term, dangerous, and deeply unfair problem. The difference is that now we are firmly and forcefully standing up for America's interests.
Should Mexico choose not to cooperate on reducing unlawful migration, the sustained imposition of Tariffs will produce a massive return of jobs back to American cities and towns.
The Washington Post reported earlier in the day that the Trump administration was considering the move, and that it had broad support in the White House - although some aides reportedly tried to talk Trump out of it.
In this photo migrants walk at dawn as part of a new caravan of several hundred people sets off in hopes of reaching the distant United States, in San Pedro Sula, Honduras.
This story will be updated.