July 13 (Reuters) - Elon Musk, the billionaire CEO of Tesla, publicly endorsed Donald Trump for the first time in the U.S. presidential race, calling the Republican former president "tough."

Musk, the world's richest person, posted the endorsement with a video of Trump with blood on his face pumping his fist after multiple shots rang out at Trump's rally in Pennsylvania on Saturday. Trump was safe.

The posts cement Musk's shift towards right-wing politics and hand Trump a high-profile backer in his quest to return to the White House in the Nov. 5 election.

"I fully endorse President Trump and hope for his rapid recovery," Musk posted on his social media platform X.

"The martyr lived," he wrote in a later post, citing a reported debate between conservative venture capitalist Peter Thiel and LinkedIn co-founder and Democratic megadonor Reid Hoffman.

Musk later posted a photograph of Trump at the event, followed by: "Last time America had a candidate this tough was Theodore Roosevelt."

Musk and representatives from X did not immediately respond to requests for comment.

Musk, who has been ramping up criticism of U.S. President Joe Biden, has donated to a political group working to elect Trump, Bloomberg reported on Friday, citing sources.

The South African-born businessman's sway stands to benefit Trump, since Musk has one of the largest footprints on X with 189.5 million followers, meaning his posts can instantaneously spread widely.

Musk has said he previously voted for Democratic presidential candidates Hillary Clinton as well as Biden.

However, in the last few years, Musk has espoused right-wing views, becoming a fierce critic of diversity initiatives, Biden's immigration policies and complaining that Democrats had given a "very cold shoulder" to Tesla and his rocket company SpaceX.

In March, Trump, who is expected to be formally nominated next week as the Republican Party's candidate for the Nov. 5 election, reportedly met with Musk and other wealthy donors.

In response to reports of the meeting, Musk posted on X: "Just to be super clear, I am not donating money to either candidate for US President." In May, he also denied media reports that there had been talks over a potential advisory role for him in any Trump presidency.

FROM "BULL***T ARTIST" TO "FAN OF ELON"

In July 2022, Musk said Trump was

"too old to be

" president of the United States, and Trump needed to "sail into the sunset." Musk also said he was leaning towards supporting Florida Governor Ron DeSantis for president in 2024.

Trump hit back, calling Musk a

"Bull***t artist"

.

Then in late 2022, Twitter reversed its ban on former U.S. President Trump shortly after Musk completed his $44 billion purchase of the controversial social media platform, which he later renamed X.

Last month, Trump said he was "a fan of Elon," adding "he does an incredible job with Tesla."

Musk said at a recent Tesla shareholder meeting that the two men had "some conversations." Trump is a "huge fan" of Tesla's electric pickup trucks, Musk said.

Trump has reiterated his pledge to immediately abandon the Biden administration's "mandate" to support the electric vehicle industry.

Musk's support for Republicans and his antisemitic and other controversial comments have alienated some Tesla customers, weighing on the carmaker's reputation and sales. (Reporting by Hyunjoo Jin and Alexandra Ulmer, additional reporting by Rami Ayyub and Gnaneshwar Rajan, editing by Deepa Babington, Lananh Nguyen and Franklin Paul)