Media playback is unsupported on your device Media caption Who is Elon Musk?

Elon Musk must step down as Tesla chair and pay a fine after reaching a deal with US regulators over tweets he posted about taking the firm private.

It follows Thursday's decision by the Securities and Exchange Commission (SEC) to sue Mr Musk for alleged securities fraud.

Under the deal, Mr Musk will remain as Tesla CEO but has to step down as chairman for three years.

Both he and Tesla will also have to pay a $20m (£15m) fine.

The SEC's chairman Jay Clayton said that he supported the deal, and felt that it was in the best interests of US markets and investors, including the shareholders of Tesla.

"This matter reaffirms an important principle embodied in our disclosure-based federal securities laws," he said.

"Specifically, when companies and corporate insiders make statements, they must act responsibly, including endeavouring to ensure the statements are not false or misleading and do not omit information a reasonable investor would consider important in making an investment decision."

What did he say in the tweets?

The fraud allegation relates to his August tweet in which Mr Musk said he was considering taking electronic car maker Tesla off the stock market and into private ownership.

He wrote he had "funding secured" for the proposal, which would value Tesla at $420 per share. Shares in the company briefly rose after his announcement, but later fell again.

The SEC said those claims were "false and misleading".

"In truth and in fact, Musk had not even discussed, much less confirmed, key deal terms, including price, with any potential funding source," the regulator said.

Mr Musk initially responded to the charges by saying the action was "unjustified" and he acted in the "best interests of truth, transparency and investors".

What is in the deal?

In addition to the fines, Mr Musk will also have to comply with company communications procedures when tweeting about the firm.

He now has 45 days to leave his role as chairman of Tesla.

The SEC had initially sought to ban Mr Musk from working on the board of any publicly traded company, but under the deal he will now be able to stay on as Tesla's chief executive officer.

A new "independent chairman" for the company will be appointed, who will preside over the company's board.

Forcing Tesla to separate the roles of CEO and chairman should limit Mr Musk's power within the company.

Despite this, many analysts say the outcome is a good one for Mr Musk, given he remains in charge of day-to-day operations as CEO.

Who is Elon Musk?

Born in South Africa, Mr Musk made millions from online payments firm PayPal before moving on to Tesla and rocket company SpaceX.

He is the 25th richest person in the world, according to Forbes, which estimates his net worth to be $19.7bn (£15.1bn).

But it has been a volatile summer for the entrepreneur.

Mr Musk is being sued for defamation after making allegations against a British diver involved in the Thai cave rescue.

Earlier this month, he found himself in another controversy after appearing on a podcast while smoking marijuana. Although the drug is legal in California, where the podcast was recorded, shares in Tesla fell more than nine per cent after his appearance.