Electric car magnate Elon Musk on Wednesday threatened to leave President Trump's advisory councils if Trump takes the U.S. out of the Paris climate change agreement.

Musk tweeted that he "[w]ill have no choice but to depart councils in that case."

The owner of the electric carmaker Tesla, and a prominent solar energy advocate, said earlier in the day he did not "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."

He said he would have no choice but to leave the business advisory panels after he was asked via Twitter what he would do if Trump exit Paris.

Musk is a member of Trump's manufacturing jobs and infrastructure councils, in addition to the president's strategic and policy forum.

Musk has faced criticism for his role on the advisory councils. He has pushed back against activists by saying they should support his membership on the advisory panels to represent a more progressive view.