Silicon Valley’s bad boy billionaire wins again.

A Los Angeles jury on Friday found Tesla CEO Elon Musk did not defame British cave diver Vernon Unsworth by calling him a “pedo guy” in a heated Twitter exchange.

The jury of five women and three returned the verdict afternoon after a four-day trial in which Musk testified for six hours. Deliberations lasted under an hour.

“My faith in humanity is restored,” the electric-car billionaire declared upon leaving the Los Angeles federal courtroom.

Musk, who has been in trouble for his tweets before, was hauled into court over his heated 2018 exchange with Unsworth over the rescue of a team of young Thai soccer players trapped in an underground cave.

After Musk and his SpaceX employees built a mini-submarine to aid with the rescue, Unsworth blasted the plan to CNN as a “PR Stunt.”

“It just had absolutely no chance of working. He had no conception of what the cave passage was like,” Unsworth said of the min-sub, which was never used in a stunning rescue that captured the world’s attention.

The Paypal co-founder responded on July 15, 2018 with a tweet dubbing to Unsworth “pedo guy” to his millions of followers.

Unsworth sued Musk in September 2018 for defamation and explained on the witness stand at trial that if he didn’t sue, people would take the allegation as true.

“When Elon Musk tweets something, it goes around the world,” his attorney said. “It can never be deleted.” The attorney, L. Lin Wood, added in closing arguments that Musk’s calling Unsworth a pedophile was like a “nuclear bomb” that would affect his relationships and job prospects for years to come.

Jurors should teach the “billionaire bully” a lesson, said Wood, who also argued that Musk should fork over damages of $190 million.

But Musk claimed in his testimony that he used the “pedo guy” phrase as a “flippant, off-the-cuff insult” fired off in anger after Unsworth belittled him on national television.

He insisted that “no one interpreted it to mean pedophile,” and likened the phrase to “motherf***er,” which, he said, doesn’t actually mean that the person being insulted is having sex with his mother.

The South African-born Musk, 48, also claimed the term was often used when he was growing up to mean “creepy old man.”

The Securities and Exchange Commission recently cracked down on Musk for tweeting that he had “funding secured” to take Tesla private at $420 a share. The agency said the claim was fraudulent and appeared to be an attempt to impress his then-girlfriend, the pop singer Grimes, with a marijuana joke.