Elon Musk has finally apologised for calling one of the divers involved in rescuing a Thai soccer team from a flooded cave, a "pedo".

The tech billionaire has been criticised for lashing out at Vern Unsworth, 63, after the British diver shot down Musk's idea to free 12 boys and their soccer coach as a "PR stunt".

The Tesla and SpaceX founder brought a mini submarine to Thailand, which he suggested could be used to get the boys out, but the idea was rejected by officials as "not practical".

"He can stick his submarine where it hurts," Unsworth said.

Advertisement

"It had absolutely no chance of working. He had no conception of what the cave passage was like."

Musk retaliated by tweeting a lengthy response, including one comment that called Unsworth a paedophile.

"We will make one of the mini-sub/pod going all the way to Cave 5 no problemo. Sorry pedo guy, you really did ask for it."

He has now apologised on Twitter for the comments. Musk tweeted a story about the controversy, commenting: "As this well-written article suggests, 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.

In a separate tweet he said: "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."