Elon Musk, the billionaire founder of SpaceX, Tesla and a growing number of other startups, announced Thursday that he will cease advising President Donald Trump in the wake of his decision to leave the Paris Agreement on climate change.

“Climate change is real,” Musk wrote on Twitter. “Leaving Paris is not good for America or the world.”

Am departing presidential councils. Climate change is real. Leaving Paris is not good for America or the world. — Elon Musk (@elonmusk) June 1, 2017

Musk had warned Wednesday that if Trump pulled the U.S. out of the landmark international accord on combating climate change, he’d have no option but to resign from his role on Trump’s business advisory council.

BRENDAN SMIALOWSKI via Getty Images President Donald Trump greets Elon Musk before a policy and strategy forum on Feb. 3 in Washington.

“Don’t know which way Paris will go, but I’ve done all I can to advise directly to POTUS, through others in WH & via councils, that we remain,” Musk tweeted, using the acronym for president of the United States.

Asked by a Twitter follower how he’d react if Trump decided to leave the agreement, Musk didn’t shy away: “Will have no choice but to depart councils in that case,” he said.

Will have no choice but to depart councils in that case — Elon Musk (@elonmusk) May 31, 2017

Musk took heat when he agreed to serve the White House in an advisory role. In the past, he rebuffed critics by arguing that his presence was “doing good.” Indeed, he used the position to advocate for immigrants and environmental issues.

This story was updated after Trump announced that the U.S. is withdrawing from the Paris Agreement.