Gary D. Cohn, President Trump’s top economic adviser, has announced that he will be resigning from his post. He will join a string of recent departures by senior White House officials. He is expected to leave in the coming weeks.

White House officials said that Cohn was leaving on cordial terms with the president. In a statement, President Trump said, “Gary has been my chief economic adviser and did a superb job in driving our agenda, helping to deliver historic tax cuts and reforms and unleashing the American economy once again. He is a rare talent, and I thank him for his dedicated service to the American people.”

Cohn was a surprising addition to the Trump administration. A onetime silver trader who eventually became the president of Goldman Sachs, Cohn was a lifelong Democrat known for having progressive social views. Although he had no political expertise, Trump was reportedly impressed with Cohn’s knowledge of economics and the markets and offered him the position as his top economic advisor.

His resignation comes after President Trump announced his plan to impose tariffs on steel and aluminum imports. Cohn had lobbied against the tariffs internally. A longtime proponent of free trade, he believed the decision could jeopardize economic growth. Cohn previously indicated that he might resign if Trump followed through with the tariffs.

The departure of Mr. Cohn could have a ripple effect on the financial industry. Last August, the mere threat that he might leave sent financial markets tumbling. Most of Trump’s remaining economic advisers have strong protectionist views and advocate the types of aggressive trade measures, like tariffs, that helped sweep him into office.

Cohn is the latest in a series of high-profile departures from the Trump administration. Rob Porter, the White House staff secretary, resigned after spousal abuse allegations. Shortly after, Hope Hicks, the president’s communications director, announced that she would also be leaving. In recent days, the president has also lost a speechwriter, an associate attorney general, and his North Korea negotiator.

Cohn is among the most senior officials to resign to date. Fewer than half of the 12 positions closest to the president are still occupied by the same people as when he came into office. More than one in three top White House officials resigned by the end of Mr. Trump’s first year.