Whether it's investors betting against his stock or reporters or analysts who ask tough questions, Elon Musk has fought back, often around the clock on Twitter.

In the past few months, the Tesla and SpaceX CEO has become a bigger, more snarling presence on social media. But when Musk called a British diver involved in the Thailand cave rescue a pedophile in front of 22.2 million Twitter followers Sunday, he may have gone one tweet too far.

The tweet, later deleted, sent investors away from Tesla stock and could expose the temperamental rocket scientist to a libel suit. In the tweets, Musk strayed from a vigorous defence of his companies into personal insult, with no facts to back it up.

"This has nothing to do with defending Tesla," said Erik Gordon, a business and law professor at the University of Michigan. "This goes over a line where he can't claim 'Well, my big sin is that I go too far in defending the company."'

In a TV interview, British diver Vern Unsworth criticized Musk and SpaceX engineers for sending a small submarine to help divers rescue the 12 Thai soccer players and their coach from a flooded cave. The submarine was not used. Unsworth called it a "PR stunt" and said it wouldn't have worked anyway.

Musk responded with a tweet branding Unsworth a "pedo." In a second tweet, Musk said he bet the claim was true. Unsworth told CNN he is considering legal action.

A Tesla spokeswoman wouldn't comment on the tweets.

For the first four months of the year, Musk was averaging around 100 tweets per month. But the tweets spiked to about 400 per month starting in May as Musk was under pressure to raise production of the Model 3 lower-priced electric car, which starts at $35,000.

As the spike occurred, Musk gained thousands of Twitter followers. He has almost half as many as President Donald Trump, who likewise attacks his critics with relish on Twitter.

Mark Spiegel, an outspoken hedge fund manager who has been betting on Tesla's stock falling for years, said the tweets are showing Musk's fans his true personality.

The company, which has had only two profitable quarters, is deep in debt and will have trouble meeting Musk's prediction of a profit in the second half of this year, Spiegel said.

"It's all based around this rabid Elon Musk fan base. Once that fan base starts to see what kind of person they've been worshipping, they will turn on you on a dime," he said.

Spiegel likened Musk to Trump, saying the two men have an "amazing amount of personality defects in common."

Previous comparisons with Trump have angered Musk. This spring, critic Andrew J. Hawkins tweeted that Musk was transforming into a "media-baiting Trump figure screaming irrationally about fake news."

Musk responded by lashing out at the media for the Trump comparisons, writing: "Why do you think he got elected in the first place? Because no one believes you any more."

In his defence, Musk posted on Twitter that leaders of the Thai rescue, in which all the boys and their coach were safely extracted, had asked him to build the mini-sub.

Tesla stock fell nearly 3 per cent Monday to $310.10 even though the broader market was up slightly.

Robert Drechsel, who taught media law at the University of Wisconsin, said if he were Tesla's attorney, he would advise the CEO to stop tweeting.

"You can't be doing yourself any favour minimally by creating this kind of a distraction, and at worst raising questions about your credibility," he said. "I'm certain they wish he would be a more cautious tweeter."

Big investors are in a difficult spot with Tesla, much as they were with Uber and ousted CEO Travis Kalanick, Gordon said. Like Uber, Tesla and SpaceX were built on their founder's larger-than-life personality. Tesla is worth more than $52 billion, largely on the promise of Musk's genius.

Until recently, Twitter and Musk's personality worked well for Tesla. The company said in its filings with the Securities and Exchange Commission that it doesn't need to advertise because it gets so much free media attention.

But Musk's "pedo" comment and his Twitter skirmishes with analysts, reporters and others will make investors wary, Gordon said.

"It's very dangerous if you just blurt things out," he said.

------

Associated Press graphic artist Francois Duckett, business writer Michelle Chapman and editor Charles Sheehan contributed to this report.