President Trump said late Thursday he will impose tariffs on all goods from Mexico unless the country moves to prevent illegal immigration to the U.S., prompting a swift slide in U.S. stock index futures.

Trump said in a statement the first round of tariffs of 5% will go into effect June 10. 

"If the illegal migration crisis is alleviated through effective actions taken by Mexico, to be determined in our sole discretion and judgment, the Tariffs will be removed," Trump said in the statement.

"If the crisis persists, however, the Tariffs will be raised to 10 percent on July 1, 2019."

The tariffs will rise to 25% by October if the U.S. is dissatisfied with Mexico's efforts, according to the statement. 

Trump speculated that "companies located in Mexico may start moving back to the United States to make their products and goods" if the tariffs remain in effect. 

S&P 500 e-mini futures fell 22.90, or 0.82% to 2,767.50. Dow and Nasdaq futures saw similar declines. 

Stocks rose modestly in the U.S. Thursday for the first time this week. Ongoing investor fears over trade wars and falling interest rates signalling an economic slowdown have hammered shares this week. 

Earlier Thursday, Trump moved to have Congress begin consideration of the United States-Mexico-Canada Agreement, which revises the North American Free Trade Agreement.