Kevin Hassett, the White House’s top economist, will leave the administration, President Trump announced on Twitter late Sunday, on the eve of his trip to Europe.

Hassett, 57, who has served as chairman of the Council of Economic Advisers since September 2017, is leaving as Trump confronts an increasingly hostile trade war on two fronts — with China and with Mexico, the latter of which Trump threatened with tariffs last week if it doesn’t do more to stem illegal migration.

A longtime conservative economist, Hassett helped shape the 2017 Republican tax law and has been a staunch defender of the president’s policies on other issues. Historically, he has been an advocate of open trade policies, although in recent months he has been put in the position of defending Trump’s most confrontational approach.

Hassett said in an interview Sunday night that his departure was unrelated to the escalating trade conflict. He said that he informed the president of his plans to leave during a conversation in the White House last week, and that he will stay in the position for about another month.

“The trade story and the departure story are completely different stories,” Hassett said, adding that he considers the post a two-year position.

Hassett’s tenure may be defined by his role in crafting the tax law, which he cited as his top accomplishment on the job along with improving the transparency of the economic models published by the Council of Economic Advisers.

The council’s arguments in support of the law have been fiercely criticized as outlandish since close to the start of debate about the legislation.

“Hassett thought the tax cut would largely go to workers’ paychecks. He was wrong,” Rep. Ro Khanna (D-Calif.) said Sunday. “He was fortunate to serve in an administration where facts don’t matter.”

Brian Riedl, a conservative analyst at the Manhattan Institute, added that Hassett’s White House legacy will likely be judged by the degree to which the tax law encourages the investment and wage growth “forcefully predicted” by the council.

“At this point, it is too early to tell,” Riedl said.

Trump said on Twitter on Sunday night that Hassett has done a great job.

A “very talented replacement will be named as soon as I get back to the U.S.,” the president wrote. “I want to thank Kevin for all he has done — he is a true friend!”

Hassett declined to comment on his conversation with Trump about a replacement, but noted that the Council of Economic Advisers was “chuck full” of good advisers.

“CEA will be in good hands,” he said. “There are plenty of great candidates, and he’ll have an announcement.”

Alan Auerbach, an economics professor at the University of California at Berkeley who taught Hassett, said that a key part of the role of economic adviser is shooting down policy proposals and that he was concerned that Hassett’s replacement may allow for the administration to execute more economically ill-advised plans.

“What bad things didn’t happen because he was there?" Auerbach said. “To the extent he did that, I think it was good that he was there.”