Entrepreneur Elon Musk, under fire for calling a British cave diver, involved in recent dramatic rescue of 13 people in Thailand, a “pedo guy,’’ apologised on Wednesday.

Musk had been responding to diver Vernon Unsworth, who said recently that Musk’s offer to send a miniature submarine to assist in the rescue operation was impractical and simply a “PR stunt”.

“My words were spoken in anger after Mr Unsworth said several untruths & suggested I engage in a sexual act with the mini-sub, which had been built as an act of kindness & according to specifications from the dive team leader.

“Nevertheless, 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 a leader,’’ he added.

Musk had previously insisted on Twitter that the submarine would have worked and vowed to make a video proving so, adding, “Sorry pedo guy, you really did ask for it’’.

In a second post, Musk doubled down on the insult but later deleted both messages.

Investors in Musk’s companies, including Tesla, the electric carmaker, had called on the CEO to apologise.