Tom Edwards posted a photo of his unicorn mugs on Facebook: Tom Edwards / Facebook

Elon Musk has reached an agreement with an artist over an image of a “farting unicorn” the Tesla boss used to promote his cars.

Tom Edwards, a potter from Colorado, US, who had claimed the business mogul had “ripped off” his drawing featured on a mug, said the issue had now been resolved "in a way that everyone feels good about".

Mr Musk had last year posted the cartoon unicorn image on Twitter, without permission, to advertise his Tesla electric car range.

Mr Edwards’s lawyer wrote to Mr Musk, and his daughter, Lisa Prank, also challenged the billionaire on Twitter, posting: “don’t you think artists deserve to be paid for their work?”.

The Tesla founder, who was at the centre of fury earlier this month for calling a British man involved in the Thai cave rescue a “paedo”, denied it was Mr Edwards’s drawing but said the publicity had increased sales of the mug.

Mr Edwards said in a blog post yesterday that he had reached an agreement with Tesla but gave no details of what the settlement involved.

“It’s clear there were some misunderstandings that led to this escalating, but I’m just glad that everything has been cleared up,” he wrote. “I’ve always been a Tesla fan, and I’m looking forward to getting back to making pots and selling them in my online store.”

After the row, Mr Edwards, 61, enjoyed a surge in sales of his mug that featured a unicorn farting electricity into a car. “Electric cars are good for the environment because electricity comes from magic,” it said.

Mr Musk had tweeted a copy of the image to promote Tesla’s new “sketch pad” feature. It also appeared as an icon on the vehicles’ operating system, and in a Christmas holiday message to customers.

After Edwards’ daughter raised it on Twitter, Musk replied: “He can sue for money if he wants, but that’s kinda lame. If anything, this attention increased his mug sales.”

Mr Musk has since deleted all his tweets related to the dispute.