(CNN) President Donald Trump threatened on Thursday to impose new tariffs on Mexico if the country does not step up its immigration enforcement actions, combining his boiling border-related frustrations with his preferred method of punishing foreign countries.

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."

The statement said Trump would carry out his threat under authority from the International Emergency Economic Powers Act and that he would lift tariffs only "if the illegal migration crisis is alleviated through effective actions taken by Mexico."

The statement warned further that if Mexico does not act as Trump demands, tariffs would go up to 10% by July, 15% by August, 20% by September and reach a permanent level of 25% by October.

Trump has grown increasingly frustrated about the border issue amid an increase in illegal crossings. He's been largely stymied by Democrats in his efforts to secure funding for a wall, and blames Central American countries for allowing large migrant flows to reach the US southern border.

Trump has also been on edge over the past days after Robert Mueller, the special counsel, delivered his first public statement saying his investigation could not determine whether Trump committed a crime.

In making the surprise announcement onm tariffs, Trump was reverting to a reliable strategy of delivering a striking directive as other negative headlines are swirling.

In a written statement, Trump painted a dark portrait of immigration in the United States, one that harkens back to some of his more fatalistic speeches, including his inaugural address.

"As everyone knows, the United States of America has been invaded by hundreds of thousands of people coming through Mexico and entering our country illegally," he wrote. "This sustained influx of illegal aliens has profound consequences on every aspect of our national life—overwhelming our schools, overcrowding our hospitals, draining our welfare system, and causing untold amounts of crime."

But in deciding to threaten tariffs on Mexico, Trump could also be imperiling his signature USMCA , a replacement for the North American Free Trade Agreement that requires low tariffs on its signatories.

Tariffs are paid by importers, not by exporting countries. If the tariffs go into effect those companies will have to decide whether to eat the cost or pass them on to American consumers.

According to the Office of the US Trade Representative, US imports of goods from Mexico totaled $346.5 billion in 2018. That includes cars and machinery as well as agricultural products.

The President preceded the statement with a pair of tweets promising that the rising tariffs would stay in place until immigration flows are cut off.

"On June 10th, the United States will impose a 5% Tariff on all goods coming into our Country from Mexico, until such time as illegal migrants coming through Mexico, and into our Country, STOP," Trump tweeted

Acting White House chief of staff Mick Mulvaney told reporters Thursday that the administration "did not set a specific percentage or specific number" for its threshold to remove tariffs.

"We are going to judge success here by the number of people crossing the border and that number needs to start coming down immediately in a significant and substantial number," he went on. "So we're going to take this and look at it on a day to day and week to week basis."

Federal law allows the use of tariffs by the president to deal with "any unusual and extraordinary threat" which deals with the "national security, foreign policy or economy of the United States," but the new measures on Mexico will likely face swift legal challenges.

Mulvaney said Thursday that the White House counsel will have to provide the legal justification for the tariffs. Privately, officials have conceded it's not clear the White House has the legal authority to impose tariffs on this scale. They are concerned that, because of the scope, the mandate will potentially face legal challenges that could leave it tied up in the courts before June 10 even gets here.

One aide to a Republican lawmaker said the economic consequences could be harsh. The White House attempted to alleviate some of this concern from their own party by sending White House counsel Pat Cipollone to brief lawmakers on Capitol Hill today.

Mulvaney told reporters that White House lawyers were able to walk through several Republican senators' concerns "to get them more comfortable" with the decision, but declined to name specific lawmakers.

The White House did not reach out to congressional Democrats about the new tariffs, he added.

The announcement and tweets came on Thursday evening, which earlier Trump had teased to reporters as a "big league" announcement on immigration . The news was first reported by The Washington Post.

"We are going to do something very dramatic on the border because people are coming into our country," the President told reporters as he left the White House on Thursday morning.

Following Trump's preview, planning regarding his tariffs threat ramped up inside the West Wing Thursday afternoon. Administration officials had mulled the idea in recent days, but they were not fully prepared to roll out the details this soon — a factor that was evident from Mulvaney's harried briefing to reporters late Thursday night.

Trump has threatened Mexico with tariffs in the past as he has grown frustrated with the flow of Central American migrants to the southern US border. He last made this threat in April amid another threat to close the border with Mexico. After walking back that threat, he suggested that tariffs would be a more effective means to pressure Mexico to do more.

Kevin McAleenan, the acting Secretary of Homeland Security, told reporters Thursday that the number of migrants crossing the border has increased consistently, thanks to the surge from Central America.

"The month of May is on pace to be the highest month in crossings in over 12 years and will significantly surpass the record 109,000 in April," he said.

"Before we close the border we'll put the tariffs on the cars," Trump told reporters. "I don't think we'll ever have to close the border, because the penalty of tariffs on cars coming into the United States from Mexico at 25% will be massive."

There is growing frustration with Mexico in the administration. US officials are not seeing a corresponding decrease in apprehensions at the US border with Mexico as a result of the country's enforcement actions at its own southern border.

If Trump makes good on a tariff threat against Mexico, it is not clear how that would affect the United States-Mexico-Canada trade deal, which the administration is pushing Congress to ratify

The Trump administration also recently released the principles of an immigration bill that would tighten asylum criteria and shift to a merit-based immigration system. But that plan has little chance on Capitol Hill and has been dismissed by even Republican lawmakers as more of a statement of principles than legislation intended to become law.

Trump continues to be frustrated by the difficulty of changing immigration law through Congress and with the asylum process, which he has complained is rife with fraud.