Elon Musk (David Paul Morris/Bloomberg News)

Tesla chief executive Elon Musk threatened Wednesday to resign his position as an adviser to President Trump if the United States withdraws from the Paris climate deal, a remark that highlights Trump's precarious position in a high-stakes international standoff.

Trump could decide as early as this week whether the United States will remain in the historic Paris agreement, which reflects a voluntary commitment by the world's governments to reduce their carbon emissions.

Musk said on Twitter that he had done all he could to advise the White House on the deal that was signed in 2016 by 195 countries.

Asked by another Twitter user what would happen if Trump withdraws despite Musk's advice, the entrepreneur said he would have “no choice” in the matter.

Tesla didn't immediately respond to a request for comment.

As a technology executive who has cited climate change as a key reason behind his push for electric vehicles, Musk has a personal and professional stake in the United States' climate-change policies.

Musk's resignation in protest would show a loss of faith in Trump by a key business leader, weakening the economic credibility Trump sought for his administration by appointing nearly 20 powerful CEOs to a advisory council in December. In addition to Musk, Trump named the chief executives of JP Morgan, Disney and IBM to the panel.

This is not the first time the future of Musk's advisory role has come into question. When Trump in January signed his controversial executive order temporarily barring refugees and some immigrants from entering the United States, a number of tech companies said their workforces were directly affected by the ban. Musk said then that he would not step down as a strategic adviser. He argued that while he did not agree with all of Trump's policies, he believed his participation was important for providing “feedback on issues that I think are important for our country and the world.”

Musk's strategic use of his position contrasts with that of Uber chief executive Travis Kalanick, who left Trump's advisory council amid widespread criticism over his role. Earlier this year, as Trump's travel ban went into effect, Uber drivers continued to pick up passengers at John F. Kennedy International Airport in New York despite an effort by taxi drivers to boycott over the issue. Uber's decision not to halt its service to JFK was viewed by some critics as a tacit endorsement of the Trump policy. Although Kalanick later said in a company-wide memo that he never intended it to be interpreted that way, the episode ultimately led to Kalanick stepping down from the business leaders council.