Elon Musk says he was responding to an “unprovoked” attack from someone he didn’t know when he called a British caver a “pedo guy.”

The Tesla Inc. chief executive officer is the first witness at his trial in Los Angeles, where the caver, Vernon Unsworth, is suing him for defamation. Musk took the stand shortly after 1 p.m., undergoing questioning from Unsworth’s lawyer L. Lin Wood.

The feud between Musk and Unsworth began when the caver criticized Musk’s effort to help rescue members of a Thai soccer team from a flooded cave in 2018 -- an event that drew the attention of worldwide media. Musk and engineers at his companies prepared a mini submarine, built with rocket parts, to help with the rescue efforts. The kids were ultimately saved without the sub.

The high-profile effort from the celebrity CEO drew derision from Unsworth, who helped in the rescue effort. He told CNN that Musk could “stick his submarine where it hurts,” that it was just a PR stunt with no chance of working.

Those comments were wrong and insulting, Musk told the jury. He said he didn’t know who Unsworth was.

“I thought he was just some random, creepy guy that the media interviewed,” Musk testified. “So, I insulted him back.”

Besides, the insult wasn’t meant to be taken literally, Musk said.

“I knew he didn’t literally mean to sodomize me with a submarine, just as I didn’t literally mean he was a pedophile,” Musk told the jury.

Musk, who is also chief executive of Space Exploration Technologies Corp., was calm and polite on the witness stand. He avoided reporters as he arrived at the courthouse in downtown Los Angeles just after noon local time.

As a scrum of journalists waited outside the courthouse, Musk’s team used a decoy car to divert attention. While a red Tesla pulled up front, Musk and his entourage of security guards emerged from around the corner and quickly entered the building.

The man with 29.8 million followers on Twitter and visions of sending people to Mars also played down his degree of influence.

“I’m not sure to the degree I’m influential,” Musk said. “I tried my best to make the U.S. government take climate change seriously,” but, he said, the Trump administration pulled out of the Paris climate accord anyway. He also told the jury Tesla doesn’t have much of a public relations department.

Musk’s testimony is continuing.

Unsworth, who sat with attorneys in the courtroom, is represented by Wood. The Atlanta attorney is best known for representing Richard Jewell, the security guard falsely accused of being connected to the Centennial Olympic Park bombing during the 1996 Summer Olympics.

Taylor Wilson, who also represents Unsworth, said in his opening statement that Musk’s tweets caused the U.K. resident tremendous shame. Unsworth, an experienced caver who is knowledgeable about the site where the boys were trapped helped connect the Thai government to British divers who helped their rescue, the lawyer said.

“Mr. Unsworth did the only thing he could,” Wilson said. He filed a lawsuit against Musk “for accusing him of being a pedophile in what should have been the proudest moment of his life.”

According to Musk’s lawyer, Alex Spiro, there’s no evidence that Unsworth suffered any damages. On the contrary, Spiro told the jurors, Unsworth became a celebrity notwithstanding Musk’s tweets and was honored by the Queen of England and the King of Thailand for his part in the rescue.

“This case is about an argument between two men exchanging insults,” Spiro said.

The case is Unsworth v. Musk, 18-cv-08048, U.S. District Court, Central District of California (Los Angeles).