Media playback is unsupported on your device Media caption Meet the man who inspired Robert Downey Jr's take on Iron Man

Electric carmaker Tesla has said it will cut its workforce by 7% after the "most challenging" year in its history.

In an email to staff on the firm's website, founder Elon Musk said that growth had been strong.

But he added it was difficult to make Teslas with their new and developing technology as cheaply as conventional cars, and the firm's cars were still "too expensive for most people".

Tesla employs more than 45,000 people, indicating it will cut about 3,000.

Shares in the car manufacturer opened more than 6% lower as trading began in the US on Friday.

Mr Musk said 2018 was Tesla's "most successful" yet, in which it delivered almost as many cars as it had in all the previous years of its existence combined.

However, while it ramped up production of its mid-market Model 3 car, Mr Musk said its products were too pricey for the average driver and its profits too low.

Image copyright AFP Image caption Tesla has stepped up production of its mid-market Model 3 car

"This quarter will hopefully allow us, with great difficulty, effort and some luck, to target a tiny profit," he wrote.

"However, starting around May, we will need to deliver at least the mid-range Model 3 variant in all markets, as we need to reach more customers who can afford our vehicles.

"Moreover, we need to continue making progress towards lower priced variants of Model 3."

He said Tesla had "no choice" but to reduce full-time employee headcount and retain "only the most critical temps and contractors".

He added the firm would need to make these cuts while "increasing the Model 3 production rate" and making many "manufacturing engineering improvements in the coming months".

It's been a tough few years for the electric carmaker and its high-profile founder.

The firm has repeatedly failed to meet its own production targets, leading many investors to bet against it.

Analysis:

Theo Leggett, business correspondent

Tesla is in a race against time.

It's already well established as a niche producer of upmarket electric vehicles. But that isn't where the company sees its future.

Electric cars at the moment are in many ways a lifestyle choice. But in future, ever tighter emissions regulations and restrictions on "regular" cars are expected to drive them into the mainstream.

It's potentially a huge market - and Tesla is targeting a significant share. That's the rationale behind its brand new Model 3, billed as an "affordable" electric car.

But the Model 3 isn't actually that affordable yet - the cheapest versions have yet to go on sale. And it needs to make a lot more of them, in order to benefit from economies of scale.

Meanwhile established manufacturers will soon be flooding the market with brand new EVs of their own.

Last year the priority for Tesla was simply to boost production as quickly as possible, to meet ambitious targets. It took on a lot of new employees to make that happen.

Now, it needs to make even more cars, more cheaply - and it will have to do so with fewer staff. That certainly won't be easy, but according to Elon Musk, "there isn't any other way".

Mr Musk was also caught up in a number of scandals, including being sued by the US Securities and Exchange Commission after tweeting that he planned to take Tesla private.

Some analysts have speculated that Tesla will turn the ship around this year, but earlier this month it fell short on quarterly deliveries of the Model 3.

It also had to cut prices in the US to offset lower green tax credits.

Image copyright EPA

In his email, Mr Musk noted the firm was cutting the jobs after expanding its headcount by almost a third in 2018.

"Tesla has only been producing cars for about a decade and we're up against massive, entrenched competitors," he said.

"The net effect is that Tesla must work much harder than other manufacturers to survive while building affordable, sustainable products."