A British diver who helped rescue youth soccer players trapped in a cave in Thailand is suing Elon Musk, alleging that the Tesla CEO falsely accused him of being a pedophile.

Diver Vernon Unsworth, who lives north of London, contends that Musk made the false allegation on Twitter and then repeated multiple other falsehoods after the dramatic rescue of a dozen youth soccer players and their coach in July.

The lawsuit filed in Los Angeles federal court Monday seeks more than US$75,000 in damages and a court order stopping Musk from making further allegations. Tesla did not immediately respond to a request for comment.

Musk called Unsworth a “pedo” in a tweet to his 22.5 million followers after Unsworth criticised Musk in a July 13 television interview with CNN about the rescue.

Musk and engineers from his rocket company, SpaceX, built a small submarine and shipped it to Thailand to help with the rescue.

The device wasn’t used and in the interview, Unsworth called it a “PR stunt” and said it wouldn’t have worked to free the boys who were trapped in the flooded cave. He also said Musk “can stick his submarine somewhere where it hurts.”

Elon Musk's prototype 'child submarine' being tested in California. (AP/AAP)

The lawsuit alleges that Musk, apparently angered by Unsworth’s remarks, began a campaign to destroy his reputation “by publishing false and heinous accusations of criminality against him to the public.”

In a series of tweets July 15, Musk, who personally delivered the submarine to the cave, wrote that he never saw Unsworth and challenged him to show a video of the final rescue.

“Sorry pedo guy, you really did ask for it,” Musk tweeted. Later on Twitter, Musk wrote “Bet ya a dollar it’s true.”

Later Musk deleted the tweets and apologised after being criticised by shareholders, the lawsuit alleged, stating in a tweet that his words were “spoken in anger” and that the sub was built out of kindness according to specifications from the dive team leader.

But on Aug. 28, Musk tweeted about Unsworth once again, writing: “You don’t think it’s strange he hasn’t sued me? He was offered free legal services.”

The lawsuit states that with the tweet, Musk sought to tell the average reader that Unsworth’s failure to sue at the time was evidence that Unsworth is a pedophile.

Tesla founder Elon Musk called British diver Vernon Unsworth a 'pedo' in a tweet. (AAP)

Two days after the Aug. 28 tweet, Musk emailed a BuzzFeed News reporter, suggesting that the reporter investigate Unsworth and “stop defending child rapists,” according to the lawsuit, which is 65 pages with exhibits.

“He’s an old, single white guy from England who’s been traveling or living in Thailand for 30 to 40 years,” Musk wrote, adding that Unsworth moved in Thailand “for a child bride who was about 12 years old at the time,” according to the lawsuit.

Then in a second email to BuzzFeed, Musk accused Unsworth of being a liar and said he wasn’t on the cave dive team.

“Mr. Unsworth is not a pedophile. Mr. Unsworth has never engaged in an act of pedophilia. Mr. Unsworth is not a child rapist,” the lawsuit stated, adding that Unsworth has never been married to a minor.

Unsworth has a “significant other” in Thailand, a 40-year-old woman with whom he shares a house, according to the lawsuit. He first started going to Thailand in 2011, where he explored and mapped caves, the documents stated.

The lawsuit explains Unsworth’s role in the rescue, saying that on June 23, when the soccer players became trapped, several Thai officials called and asked him to go to the cave as soon as possible. He was the first foreign rescuer to arrive.

The Thai youth soccer team after their rescue from a flooded cave by divers. (AAP)

He recommended that the Thai government seek help from divers in the United Kingdom, and Unsworth called friend and fellow diver Rob Harper. Harper, who had just returned from exploring Thai caves with Unsworth, brought two other divers, John Volanthen and Rick Stanton, to help with the rescue.

The boys, ages 11-16, were found July 2 by Volanthen and Stanton, according to the lawsuit.

The last soccer player was rescued July 8. “Together with Mr. Unsworth, Mr. Harper, Mr. Volanthen, and Mr. Stanton put together the dive portion of the rescue plan that ultimately saved the boys,” the lawsuit stated. It concedes that Unsworth was not involved in the final planning stages of the rescue because he didn’t have enough experience to make the dive.

The lawsuit was filed by lawyers led by L. Lin Wood, an Atlanta lawyer who has represented plaintiffs in several high-profile libel cases including the family of homicide victim JonBenet Ramsey and security guard Richard Jewel, who was accused in media reports of being a suspect in a 1996 bombing during the Olympics in Atlanta, a crime committed by anti-government extremist Eric Rudolph. The documents said a separate lawsuit would be filed in England.

Unsworth will not do interviews, Wood said, but the lawyer said in a statement that Musk’s wealth “cannot convert his lies into truth or protect him from accountability for his wrongdoing in a court of law.”

AFP divers in the dark and murky waters of the cave system. (Australian Federal Police)

Unsworth’s British lawyer, Mark Stephens, said that “Twibels (Twitter libels) show that falsehoods by the rich and powerful can circulate round the globe to their 22.5 million followers and to the media before the truth can pull its boots on.”

“The truth has now got its boots on and Elon Musk is being brought to account for repeatedly attacking and taunting the good name of an ordinary spelunker: Vernon Unsworth who answered the call and (with others) put his life on the line to help rescue the 13 trapped in the caves in Thailand,” he said.