The comments were made in a row during the rescue of a Thai football team
Entrepreneur Elon Musk has apologised for calling a cave diver a "paedo" on Twitter.
The comments were made in a row, which erupted during the rescue for the football team trapped in the Thai caves.
All of the boys and their coach were rescued in a successful three-day operation.
Musk has now apologised in a tweet, replying to an article defending and celebrating the Tesla CEO.
British cave diver Vernon Unswort (63) said he was considering taking legal action against the billionaire after Musk made an unfounded allegation that he was a paedophile.
In his apology, the Tesla CEO said his words were "spoken in anger" in response to Mr Unsworth speaking "several untruths" about the "impractical" submarine which the billionaire chief executive left in Thailand.
Mr Musk stated that he was particularly offended by Mr Unsworth's description of the submarine as a "PR stunt" and stating that he could stick the submarine "where it hurts".
At the time, despite being told by the head of the rescue operation that the submarine was not practical for the rescue mission, Musk stated he was leaving the submarine "here in case it may be useful in the future".
Mr Musk added that his "mini-sub... had been built as an act of kindness & according to specifications from the dive team leader.
"Nonetheless, his actions against me do not justify my actions against him, and for that I apologise to Mr Unsworth and to the companies I represent as leader. The fault is mine and mine alone."
Nonetheless, his actions against me do not justify my actions against him, and for that I apologize to Mr. Unsworth and to the companies I represent as leader. The fault is mine and mine alone.— Elon Musk (@elonmusk) July 18, 2018
The apology was also extended to the companies Mr Musk represents - he was facing considerable pressure from Tesla investors to retract his accusation.
Tesla shareholders published an open letter warning the CEO that he risked losing their confidence.
Others warned that his behaviour could have "a dramatic negative impact on the company".
Following the apology, Tesla shares were up 4% pre-market.