“We’re bringing it all back,” he added.
Friday morning, Mr. Trump tweeted that a trade war would be a positive development in the context of the United States’ current position with its trading partners.
Stocks fell in response to the potential tariffs, with declines in the industrial sector outpacing the overall market. The Standard & Poor’s 500 industrial sector was down 1.9 percent, compared with a decline of about 1.3 percent in the overall benchmark index. Shares of American automakers, all large consumers of steel and aluminum, declined, as did shares of Boeing, a large exporter that could be hurt if other nations retaliate against United States tariffs.
Mr. Trump’s announcement came despite months of heavy pushback from American companies that use metals in their products, like automakers and food packagers, and foreign officials, who warned that tariffs would strain relations and could prompt retaliatory trade actions. It also elicited a swift and severe response from Republican lawmakers, who said the action would ultimately hurt American companies, workers, consumers and the economy.
The announcement capped a frenetic and chaotic morning as Mr. Trump summoned more than a dozen executives from the steel and aluminum industry to the White House, raising expectations that he would announce his long-promised tariffs.
Mr. Trump raised the specter of action with an early morning Twitter post, saying: “Our Steel and Aluminum industries (and many others) have been decimated by decades of unfair trade and bad policy with countries from around the world. We must not let our country, companies and workers be taken advantage of any longer.”
Yet the legal review of the trade measure had not been completed and, as of Thursday morning, White House advisers were still discussing various outcomes for tariff levels and which countries could be included, according to people familiar with the deliberations. Just an hour before Mr. Trump made his remarks, a White House spokeswoman said that no announcement was expected that morning.
Advisers have been bitterly divided over how to proceed on the tariffs, including whether to impose them broadly on all steel and aluminum imports, which would ensnare allies like the European Union and Canada, or whether to tailor them more narrowly to target specific countries.
Imposing tough sanctions would fulfill the president’s promises but could tip off trade wars around the world as other countries seek to retaliate against the United States. Foreign governments, multinational companies and the Pentagon have continued to push against broad tariffs, arguing that the measures could disrupt economic and security ties.
Brazil, Canada, Germany, Mexico and South Korea were the largest suppliers of steel to the United States in 2017, while Canada, Russia and the United Arab Emirates shipped the largest share of aluminum imports in 2016.
On Thursday, Canada, the European Union and other countries said they might have no choice but to retaliate in response.
The president of the European Commission, Jean-Claude Juncker, called the measure “blatant intervention to protect U.S. domestic industry” and said the European Union had been a close security ally of the United States for decades.
“We will not sit idly while our industry is hit with unfair measures that put thousands of European jobs at risk,” Mr. Juncker said.
Chrystia Freeland, the Canadian minister of foreign affairs, called any measure that deemed Canadian trade a national security threat “entirely inappropriate.”
“Should restrictions be imposed on Canadian steel and aluminum products, Canada will take responsive measures to defend its trade interests and workers,” she said.
That is the exact situation Mr. Trump’s pro-trade advisers have long feared and worked to prevent. Gary D. Cohn, the director of the National Economic Council, had been lobbying for months alongside others, including Defense Secretary Jim Mattis and Rob Porter, the staff secretary who recently resigned under pressure from the White House, to kill, postpone or at least narrow the scope of the measures, people familiar with the discussions said.
But in recent weeks, a group of White House advisers who advocate a tougher posture on trade has been in ascendance, including Robert E. Lighthizer, the country’s top trade negotiator and a former steel industry lawyer; Wilbur Ross, the commerce secretary who led the metals investigation; and Peter Navarro, a trade skeptic who had been sidelined but is now in line for a promotion.
Mr. Cohn threatened to resign if the White House followed through with stiff and sweeping tariffs, according to people who have spoken with him in recent days.
The departure of Mr. Porter, who organized weekly trade policy meetings and coordinated the trade advisers, has helped fuel a chaotic situation that has descended into an all-out war among various trade advisers, people close to the White House said.
The White House has been on the brink of announcing steel and aluminum tariffs several times in the past eight months, including in June. In recent days, the president appears to have grown impatient for action.
Supporters of the tariffs have begun broadcasting televised ads in recent days during programs that Mr. Trump has been known to watch. One such ad ran on Fox News minutes before the president’s Twitter post on Thursday morning.
But the tariffs have divided industries, workers and policymakers. American manufacturers of steel and aluminum pressed the White House to take action against cheap imports, which they say hurt their ability to compete. Companies that use steel and aluminum in their products say tariffs would raise their costs, eating into profits or forcing them to raise prices or lay off workers.
Scott N. Paul, the president of the Alliance for American Manufacturing, which represents steel companies and workers, said the president made “an encouraging show of support” on Thursday morning but now needed to act.
“The president’s enforcement action must be broad, robust and comprehensive,” Mr. Paul said.
Republican lawmakers blasted the announcement, underlining how far Mr. Trump has strayed from the party’s traditional orthodoxy of embracing free and open markets. Senator Orrin G. Hatch, Republican of Utah and the chairman of the Senate Finance Committee, called tariffs “a tax hike the American people don’t need and can’t afford.”
“Let’s be clear: The president is proposing a massive tax increase on American families,” said Senator Ben Sasse, Republican of Nebraska. “You’d expect a policy this bad from a leftist administration, not a supposedly Republican one.”
But Sherrod Brown, Democrat of Ohio, defended the president, calling the announcement a “long overdue” action for steelworkers in his state.
The prospect of tariffs seemed likely to incite a period of fierce lobbying by foreign governments and multinational companies who will argue that their products should be exempted from any sanctions. It could also result in protracted fight at the World Trade Organization.
The World Trade Organization provides substantial leeway for countries to pursue trade measures in their national security interest, but few countries have tested those permissions.
Jennifer A. Hillman, a professor at Georgetown Law, said she expected countries to bring challenges and that the outcome could be negative, whether the United States wins or loses.
A ruling against the United States might feed an opinion already popular in the Trump administration that global trade rules compromise American sovereignty, and provide a reason to potentially withdraw from the organization.
Even a ruling in Washington’s favor could prompt others to follow the United States in using national security concerns to justify a vast array of measures to shut off their own markets from American products.
“Arguably every other country in the world can do the same thing,” Ms. Hillman said. “You’ve really now walked away from a rules-based trading system.”