Image copyright Getty Images

Elon Musk has survived a bid to strip him of a key role at Tesla as shareholders re-elected three directors to the electric car maker's board.

One investor wanted to strip the Tesla founder and chief executive of his other role as chairman.

The two positions are often held by the same person in US companies, unlike in UK firms.

That proposal was voted down at Tesla's annual meeting in Mountain View, California, on Tuesday.

The company used the meeting to reveal that its newest "gigafactory" would be built in Shanghai, with an announcement about the Chinese factory coming "really soon", Mr Musk said.

The bid to strip him of the chairmanship was the strongest challenge yet to Mr Musk's control of Tesla, in which he holds a 20% stake.

Some investors have been unnerved by the company's struggle to speed up production of its more affordable Model 3 car, which is crucial to the company's long-term profitability.

Is Tesla heading for trouble?

Musk: No 'bonehead' questions please

Mr Musk said that reaching its goal of building 5,000 Model 3 cars a week by the end of this month was "quite likely" as its production lines were now producing 3,500 vehicles a week.

"This is the most excruciating hellish several months I've ever had... but I think we're getting there," he told investors.

"At Tesla we build our cars with love," Mr Musk said, visibly moved. "At a lot of other companies, they're built by marketing or the finance department and there's no soul. We're not perfect, but we pour our heart and soul into it and we really care."

Image copyright Getty Images Image caption Tesla's Model 3 is crucial to the company's profitability

Activist investor CtW Investment Group had called on shareholders to reject three Tesla directors it said lacked qualifications or independence:

Antonio Gracias, Tesla's senior independent director

James Murdoch, chief executive of Twenty-First Century Fox

Kimbal Musk - Elon Musk's brother

CtW, along with proxy firms Glass Lewis and Institutional Shareholder Services (ISS), had backed the proposal to separate the chairman and chief executive roles and mostly opposed re-electing the three directors.

Tesla had recommended investors allow Mr Musk to keep both roles and argued that the directors were qualified.

He came under fire last month for refusing to answer questions from analysts about the company's finances, saying "boring bonehead questions are not cool".

Instead Mr Musk allowed a YouTube vlogger and journalist, Galileo Russell, to ask 10 questions on the results call.

The electric car maker posted a record quarterly loss of almost $710m (£523m) for the three months to March - more than double the same period last year.

Shares in Tesla have proved volatile in recent months and fell to about $252 in April. The stock closed on Tuesday at just over $291, but had been as high as $389 in September.

The company is still valued at almost $50bn - nearly $5bn more than car maker Ford is worth.