British diver Vernon Unsworth had sued Elon Musk over his comment.

Elon Musk on Monday said he did not intend to accuse a British diver of pedophilia by branding him a "pedo guy" on Twitter, as the Tesla Inc chief executive sought to dismiss a defamation lawsuit.

Musk posted the tweet, for which he later apologised, after Vernon Unsworth accused Musk in a CNN interview of grandstanding by offering to help Unsworth's diving team rescue 12 boys and their soccer coach from a Thailand cave in July 2018.

Unsworth sued two months later in Los Angeles federal court, saying Musk falsely branded him a pedophile and child rapist.

"'Pedo guy' was a common insult used in South Africa when I was growing up," Musk, 48, who was raised in Pretoria, said in a court filing. "It is synonymous with 'creepy old man' and is used to insult a person's appearance and demeanour.

"I did not intend to accuse Mr. Unsworth of engaging in acts of pedophilia," Musk added. "In response to his insults in the CNN interview, I meant to insult him back by expressing my opinion that he seemed like a creepy old man."

Musk also said his "off the record" August 2018 email to a BuzzFeed News reporter urging him to "stop defending child rapists" was based on a private investigator's report on Unsworth, and that he did not then know the statement was false.

Unsworth has denied Musk's allegations, and has said he had shared a house in the Thailand countryside with a 40-year-old woman who owned a nail salon.

L. Lin Wood, a lawyer for Unsworth, did not immediately respond to requests for comment.

The dispute arose after Unsworth told CNN that a mini-submarine offered for the rescue from the Tham Luang Nang Non cave by Musk's company SpaceX was a "PR stunt" and Musk could "stick his submarine where it hurts."

In a related court filing, Musk's lawyers called Unsworth a public figure on matters related to the cave rescue.

They said this required Unsworth to show by clear and convincing evidence that Musk made his statements towards him with "actual malice," a high standard.

Unsworth is seeking compensatory and punitive damages. A trial is scheduled for Dec. 2.

Musk's Twitter use prompted a U.S. Securities and Exchange Commission lawsuit. A settlement approved in April sets out when Musk must obtain advance approval from a Tesla securities lawyer before posting.