Tesla founder Elon Musk has apologised to British caver Vern Unsworth for comments he made about him following the rescue of a dozen schoolboys and their football coach from a cave in northern Thailand.

"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," Mr Musk said in a tweet. "The fault is mine and mine alone."

He was responding to a Twitter user who had shared an article about the dispute.

Mr Unsworth, who played a leading role in the rescue, said yesterday that he had been approached by British and US lawyers and would seek legal advice after Mr Musk directed abuse at him on Twitter.

Mr Musk's spat with Mr Unsworth started last week, after rescue teams rejected the tech billionaire's offer of a mini-submarine created by his rocket company SpaceX to help extract the boys and their coach from the labyrinth of partly flooded passages.
           
"It just has absolutely no chance of working," CNN quoted Mr Unsworth as saying about the submarine.

Mr Musk tweeted that the sub would work and made a sexual slur against Mr Unsworth in a tweet that was later deleted.

The football team and their coach are expected to leave hospital today.

Mr Unsworth said he had not actually met Mr Musk face-to-face when he visited the cave during the rescue.

He said he felt sorry that the squabble with Mr Musk had detracted from the successful end to the mission.

"It's taken a bit of the pleasure out of what's happened, what we've achieved, for me anyway," he said, adding that it had upset his ex-wife and daughter back in Britain.

Mr Musk's tweet about Mr Unsworth, which was sent from his official account, caused Tesla's shares to fall on Monday, although they have since recovered the losses.