Updated at 3:05 p.m. ETTech entrepreneur Elon Musk has apologized for his part in a spat with a British diver involved in the rescue of 12 boys and their soccer coach trapped in a flooded cave in Thailand. Musk had tweeted a personal attack on Vern Unsworth, calling him a pedophile after the diver dismissed Musk's offer of help with a vulgar comment.Musk wrote, "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."Musk had offered to build and supply a minisub to get the boys and their coach out of the flooded cave, at a time when officials worried that it could be weeks or months before they could be rescued.Thai navy SEAL divers rescued all 13 last week; days later, Unsworth dismissed Musk's minisub offer as a "PR stunt" that wouldn't have worked. He also said Musk could "stick his submarine where it hurts."The founder of Tesla and SpaceX responded by challenging Unsworth, saying a video would prove his idea was valid. Musk then added, "You know what, don't bother showing the video. We will make one of the mini-sub/pod going all the way to Cave 5 no problem. Sorry pedo guy, you really did ask for it."Musk's calling Unsworth a pedophile surprised many — and the episode was seen as playing a role in a sudden 4 percent drop in Tesla's stock price.On Wednesday, Musk said in a tweet that Unsworth's "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," Musk said.Musk's Twitter feed has long been the source of news about his company's innovations and ambitions — as well as a platform for him to try to correct the record when he feels a distorted view of himself or his projects has emerged. Over the weekend, for instance, Musk devoted several tweets to clarify his political stance and donations.On Tuesday night, a Twitter user named Lane Roberts urged Musk to "regulate your tweets" — in large part, Roberts said, because negativity could overshadow his efforts to help improve life on a broad scale.Musk replied, "Good point." Copyright 2018 NPR. To see more, visit http://www.npr.org/.