Elon Musk did not defame a British cave explorer by calling him a “pedo guy” on Twitter, a jury concluded on Friday in Los Angeles. The verdict ended a short trial based on an acrid dispute between the men over the high-profile rescue of a group of children trapped in Thailand in the summer of 2018.

“My faith in humanity is restored,” Mr. Musk told reporters after hearing the verdict.

The explorer, Vernon Unsworth, sued Mr. Musk in September last year, arguing that the billionaire had used the tweet to insinuate that Mr. Unsworth was a pedophile and damage his reputation. Mr. Musk, the chief executive of Tesla, and his lawyers countered that “pedo guy” was a generic insult borrowed from his youth in South Africa.

Both men had become involved in the rescue shortly after rising waters trapped a boys’ soccer team in a cave in June 2018. Mr. Unsworth had firsthand knowledge of the cave system, while Mr. Musk flew in a team of engineers and proposed an unorthodox rescue plan using a minisubmarine.

After Mr. Unsworth slammed the idea in a televised interview, suggesting that Mr. Musk “stick his submarine where it hurts,” the billionaire lashed out on Twitter, describing Mr. Unsworth as a “pedo guy” in a post to his 22 million followers at the time.