President-elect Donald J. Trump’s threat to impose 25 percent tariffs on goods from Mexico and Canada sent shivers on Tuesday through the auto industry, which depends heavily on both countries for parts and manufacturing.

The prospect of tariffs “is a two-alarm fire for the auto industry,” said Patrick Anderson, chief executive of Anderson Economic Group, a consulting firm in Michigan. “There is probably not a single assembly plant in Michigan, Ohio, Illinois and Texas that would not immediately be affected by a 25 percent tariff.”

The list of popular vehicles made in Mexico or Canada is long. It includes Ram pickups made by Stellantis in Saltillo, Mexico, and Chrysler minivans built in Windsor, Ontario. General Motors makes Chevrolet Silverado pickups and electric versions of Equinox and Blazer S.U.V.s in Mexico, where Ford also makes its Maverick pickup.

All of those vehicles and many others would become significantly more expensive if Mr. Trump, who won the state of Michigan with promises to preserve auto jobs, followed through on his threat. Those higher auto prices would have a significant effect on overall inflation.

Mexico and Canada are also major suppliers of components to virtually all manufacturers including Tesla, whose chief executive, Elon Musk, was a big supporter of Mr. Trump’s campaign and is expected to play a significant role in his administration.

Mr. Trump said tariffs would remain in place until Mexico stops the flow of illicit drugs and unauthorized immigrants to the United States. But tariffs could lead to an increase in migration if some of the one million Mexicans who work in the auto industry lost their jobs, analysts say.

Wall Street was clearly alarmed. G.M.’s stock was down about 8 percent on Tuesday morning after Mr. Trump’s statement on tariffs. Stellantis, the owner of Ram, Jeep and Chrysler, fell about 5 percent, and Ford was down 2 percent.

Tariffs “would spell disaster for the U.S. auto industry,” analysts at Bernstein said in a note to investors. But, they added, they doubt Mr. Trump will follow through.

“Given the wide-ranging negative implications for industrial production in the U.S., we expect this is unlikely to happen in practice,” the Bernstein analysts said.