By Agence France-Presse
Cohn led the charge on a tax cut proposal approved by Congress in December, but lost the internal struggle against more protectionist voices over trade tariffs.
"Gary has been my chief economic advisor and did a superb job in driving our agenda," Trump said in a statement. "He is a rare talent, and I thank him for his dedicated service."
The White House downplayed the idea Cohn resigned over more aggressive trade policies, but only moments before the announcement Trump showed no signs of backing down even in the face of opposition from his own party.
Speaking to reporters, Trump said he was elected to protect American workers and industries that had been harmed by years of unfair trade policies.
"Our country has been taken advantage of by everybody. By everybody. And we cannot let that happen any longer," Trump said during a joint press conference with Swedish Prime Minister Stefan Lofven.
But Trump's aggressive plan to punish abusers by imposing 25 percent tariffs on steel and 10 percent on aluminum, against friend and foe alike, angered US trading partners.
It also startled US automakers and firms that rely on those metals and the free flow of trade.
Even administration officials were caught off guard by the announcement late last week, since the legal review had not been completed.
Reports of Cohn's likely resignation began to circulate almost immediately.
It appears the 57-year-old former Goldman Sachs executive was drowned out by a decidedly more protectionist team including trade adviser Peter Navarro and Commerce Secretary Wilbur Ross.
Cohn is the latest in a long string of senior advisors to resign or be fired, a virtually unprecedented turnover of administration staff.
Hope Hicks, perhaps Trump's most trusted confidante, announced last Wednesday that she would resign as communications director.
Her move followed the departures of chief of staff Reince Priebus, national security advisor Michael Flynn, and others.
Markets became convinced Tuesday that the tariffs might not be that bad and a trade war could be averted, but Cohn's departure could portend a rocky trading session on Wednesday.
The tariff plan -- which Trump followed up with a threat to impose "reciprocal taxes" on all imports from countries that charge duties on US exports -- also sent shivers through Republican leaders, whose party has traditionally embraced free trade.
House Speaker Paul Ryan was in the vanguard, calling on Trump to have a "smarter" plan that was "more surgical and more targeted."
While there was "clearly abuse occurring" regarding overcapacity and dumping particularly by China, protectionist measures could have the "unintended consequences" of a trade war, Ryan told reporters.
But Trump once again dismissed the concerns about sparking a global confrontation, saying "trade wars aren't so bad... the trade war hurts them. It doesn't hurt us."
- Retaliation and counter-retaliation -
Earlier Tuesday, Treasury Secretary Steven Mnuchin said Trump understands "the potential impact" of the measures on the economy.
Mnuchin noted that he has been working on the specifics of the tariff plan, which will be announced this week, "and I think we have a way of managing through this."
Trump himself said, somewhat cryptically, that the measures will be imposed "in a long, loving way."
Despite those apparent assurances, the EU already has threatened to retaliate against American blue jeans, bourbon and Harley-Davidson motorcycles.
Mexico's Economy Minister Ildefonso Guajardo vowed Tuesday to fight back against US tariffs and target "the things they export that are most politically sensitive."
Trump again hit out at the threats of countermeasures, saying if the EU reacts, "then we put a big tax of 25 percent on their cars and believe me, they won't be doing it very long."
He also criticized Europe for making it "almost impossible for us do business with them."
It is just that kind of tit-for-tat confrontation that has economists fearing a real chance of a trade war that could do serious global economic damage.
Economist Ian Shepherdson of High Frequency economics said Trump is "playing with fire."
"While the steel and aluminum industries are tiny relative to the overall economy, tariffs on those sectors are likely to lead to retaliation from other countries, with the Trump administration then potentially retaliating against the retaliation," he said in a research note.