Elon Musk has apologized for calling a British diver involved in the Thailand cave rescue a pedophile.

In a series of tweets late Tuesday, the Tesla CEO said he had “spoken in anger” on Sunday after diver Vern Unsworth accused Musk and SpaceX engineers of orchestrating a “PR stunt” by sending a small submarine to help divers rescue the 12 Thai soccer players and their coach from a flooded cave.

Musk says Unsworth’s criticism upset him but he should not have branded the diver a “pedo.” Musk said, “The fault is mine and mine alone.”

Musk’s Sunday tweet, later deleted, had sent investors away from Tesla stock, which fell nearly 3 percent Monday. Unsworth told CNN earlier this week that he is considering legal action.

The apology came in the wake of growing criticism about Musk’s social media usage. For example, on Tuesday a top tech analyst sent a simple message to Musk: Get off Twitter.

Gene Munster, the managing partner at Loup Ventures, penned an open letter to the Tesla CEO urging him to rein in his outbursts and erratic behavior so he might “regain investor confidence.”

“Your behavior is fueling an unhelpful perception of your leadership — thin-skinned and short-tempered,” Munster wrote in a letter posted “on behalf of investors who believe in you and your mission.”

“Thankfully, the road to regaining investor confidence is well traveled. It starts with an apology,” Munster wrote. “Then, focus your message on your progress toward achieving Tesla’s mission.”

Finally, Munster wrote, “you might consider taking a Twitter sabbatical.”

The comment about the caver was far from the first Twitter outburst for Musk, who is fond of talking about tweeting on Ambien. He has repeatedly lashed out at journalists amid critical coverage of Tesla, which has missed Model 3 production goals, lost top executives, and clashed with government investigators. He even teased plans to launch a service called Pravda to rate the credibility of specific journalists and news outlets.

His erratic behavior extends beyond his penchant for ranting in 280 characters. During a recent earnings call, he interrupted analysts who asked about capital expenditures and production of Tesla’s first mass market car, the Model 3. “Boring, bonehead questions are not cool,” Musk told one analyst.

Musk’s antics have raised concerns about alienating customers and investors at a time when Tesla is struggling to become a mass-market automaker.

Given the pressure, Musk may want to reconsider his approach to dealing with his critics, said Bryan Reber, who teaches public relations at the University of Georgia.

“The CEO is always vulnerable when an organization is in crisis,” Reber said. “When you’re the face of the company, as Elon Musk is, that vulnerability and responsibility is only ratcheted up. It’s probably time, actually past time, that Musk apologize, step away from social media and lay low for awhile.”