Even the mere threat, last August, that Mr. Cohn might leave sent the financial markets tumbling.
And his planned exit comes as the president is making a more aggressive return to the nationalist policies that helped sweep him into office as the 2018 midterm elections approach.
Mr. Trump’s announcement last week that he would levy tariffs on aluminum and steel imports was the most immediate catalyst for Mr. Cohn’s departure, according to people familiar with his thinking. Mr. Cohn, a longtime proponent of free trade, believed the decision could jeopardize economic growth.
His plan to leave also followed conversations Mr. Cohn held with the president in recent weeks about the possibility of replacing John F. Kelly as White House chief of staff, said people who were briefed on the matter. The president never formally offered Mr. Cohn the job, those people insisted, but Mr. Trump had discussions with him about whether he would be interested.
Mr. Kelly said he would “miss having him as a partner in the White House, but he departs having made a real impact in the lives of the American people.”
People close to Mr. Cohn said that he had planned to stay for roughly a year, and that he had accomplished a number of things he cared about. That included the $1.5 trillion tax cut that Republicans passed last year.