He said the “difficult but necessary” decision was the result of a comprehensive organizational restructuring, targeting duplication as well as some job functions that, “while they made sense in the past, are difficult to justify today.”

“Given that Tesla has never made an annual profit in the almost 15 years since we have existed, profit is obviously not what motivates us,” he wrote. “What drives us is our mission to accelerate the world’s transition to sustainable, clean energy, but we will never achieve that mission unless we eventually demonstrate that we can be sustainably profitable. That is a valid and fair criticism of Tesla’s history to date.”

Those affected by the layoffs were being notified this week, he said. Tesla employs nearly 40,000 employees worldwide, which means a 9 percent cut would translate to about 3,400 lost jobs.

Tesla would be providing laid-off employees with salary payments and stock vesting proportionate to length of service, Musk said.

He said that the job cuts were almost entirely made from the ranks of salaried employees, and that no production associates were included, “so this will not affect our ability to reach Model 3 production targets in the coming months.”

Difficult, but necessary Tesla reorg underway. My email to the company has already leaked to media. Here it is unfiltered: pic.twitter.com/4LToWoxScx

Reaching production targets, including a goal of building 5,000 Model 3 electric cars per week by the end of this month, is seen as the other requirement for notching a profitable quarter later this year.

Musk said “Tesla will still continue to hire outstanding talent in critical roles as we move forward, and there is still significant need for additional production personnel.”

Musk pledged to hit the 5,000-a-week goal as well as the profitability target during Tesla’s annual shareholder meeting last week. Tesla share prices rose more than 10 percent after Musk made those pledges, but they fell back somewhat immediately after the layoffs came to light.

In addition to the layoffs, Musk said Tesla has decided not to renew its residential sales agreement with Home Depot “in order to focus our efforts on selling solar power in Tesla stores and online.” Most of the Tesla employees working at Home Depot would be offered positions at Tesla retail locations, he said.

In the memo, Musk said “we are making this hard decision now so that we never have to do this again.”