WASHINGTON — President Trump said on Thursday that he planned to give Mexico a “one-year warning” before closing the southern border, retreating on a threat he made last week that he would close the border in the coming days if Mexico did not halt all illegal immigration.

“The only thing, frankly, better and less drastic than closing the border is tariff the cars coming in, and I will do it,” Mr. Trump said, speaking to reporters after a meeting with the White House Opportunity and Revitalization Council. “I don’t play games.”

He added: “If the drugs don’t stop, or largely stop, we’re going to put tariffs on Mexico and products, in particular cars — the whole ballgame is cars. And if that doesn’t stop the drugs, we close the border.”

[Sign up for Crossing the Border, a limited-run newsletter about life where the United States and Mexico meet.]