WASHINGTON — Paul D. Ryan, the Republican House speaker, criticized President Trump’s proposed steel and aluminum tariffs on Monday, saying they could lead to a damaging trade war.

“We are extremely worried about the consequences of a trade war and are urging the White House to not advance with this plan,” a spokeswoman for Mr. Ryan said in a statement. “The new tax reform law has boosted the economy and we certainly don’t want to jeopardize those gains.”

The statement was a dramatic departure for Mr. Ryan, a top leader in Mr. Trump’s own party, who worked in lockstep with the president to pass a $1.5 trillion tax cut last year. While other Republican lawmakers have come out against the president’s trade action, this was Mr. Ryan’s first public comment since Mr. Trump announced last week that he would impose tariffs of 25 percent on steel and 10 percent on aluminum.

Mr. Trump has shown no sign that he plans to retreat from the trade action. On Monday, he used the tariffs to threaten two of the United States’ closest trading partners, saying in a tweet that the tariffs would only “come off” of Canada and Mexico if a new and “fair” multilateral trade pact was signed.

The statement continued Mr. Trump’s running Twitter defense of the tariffs, which he has positioned as necessary to help the United States protect itself against foreign competitors. But his administration continues to sow confusion over the breadth, scope and legality of the tariffs on steel and aluminum that Mr. Trump announced last Thursday. The White House has said those tariffs would apply to imports from all countries with no exemptions.

Mr. Trump’s tweet came as the United States, Mexico and Canada are wrapping up the seventh round of talks over the North American Free Trade Agreement in Mexico City. Negotiators have continued to clash over provisions in the pact, including rules for auto manufacturing, and the United States has continued to insist on changes that its trading partners say are nonstarters.

“We have large trade deficits with Mexico and Canada,” the president tweeted Monday. “NAFTA, which is under renegotiation right now, has been a bad deal for U.S.A.”

Opening up exceptions for countries like Canada and Mexico for other factors like Nafta could also invite more challenges at the World Trade Organization, said Jennifer Hillman, a professor at Georgetown University Law Center. That body requires that members treat all other members equally when it comes to trade. “Unequivocally, I think there will be cases filed at the WTO, and there is plenty of ground to challenge this,” Ms. Hillman said.

On Sunday, two of the president’s top trade advisers defended the tariff plan but left room for the president to change his mind. Peter Navarro, the head of the White House Office of Trade and Manufacturing Policy, said the tariff announcement could come this week or the following week at the latest. Wilbur Ross, the secretary of commerce, acknowledged that the president could change his mind, while adding that he had no reason to do so.

The president’s announcement was cheered by steel and aluminum companies but rattled stock markets, allies and industries that purchase metal to make their products, who could see their prices rise as a result. The European Union, Canada and other countries have already threated retaliation on American products and cases against the United States at the W.T.O. Mr. Trump has threatened additional retaliation in response, saying in a tweet over the weekend that the United States would make it harder for the European Union to sell cars here if it erects trade barriers on American imports.