Tesla will lay off 9% of its employees beginning this week, CEO Elon Musk said on Tuesday.

The layoffs will not affect production-line workers as the company ramps up Model 3 production.

During Tesla's first-quarter earnings call in May, Musk said the company would begin restructuring operations in an effort to meet its profitability goals.

Musk has said the company will become profitable in the second half of the year and won't need to raise money.

On Tuesday, Musk also said Tesla would not renew its agreement with Home Depot to sell solar panels and battery packs at the retailer's stores.

Tesla will lay off about 9% of its employees beginning this week, CEO Elon Musk said on Tuesday.

Musk posted an email he sent to Tesla employees on Twitter after the email leaked to news outlets.

"Difficult, but necessary Tesla reorg underway," Musk said in a tweet accompanying images of the email.

In the email, Musk said the layoffs would primarily affect salaried employees, sparing production-line workers as the company ramps up Model 3 production. He said Tesla had developed redundancies in some job functions that were no longer necessary.

Employees who are laid off will receive "significant salary and stock vesting" from the company, Musk said, adding that Tesla would continue to hire for important roles, particularly those involved in vehicle production.

"We made these decisions by evaluating the criticality of each position, whether certain jobs could be done more efficiently and productively, and by assessing the specific skills and abilities of each individual in the company," he said. "As you know, we are also continuing to flatten our management structure to help us communicate better, eliminate bureaucracy and move faster."

The company has about 46,000 employees, so the layoffs could affect about 4,000 people.

During Tesla's first-quarter earnings call in May, Musk said the company would begin restructuring operations in an effort to meet its profitability goals. At the time, Musk said it would entail "flattening the management structure."

Musk said in a letter to employees in May that the company would reevaluate all its contractors.

Musk has said Tesla will become profitable in the second half of 2018 and won't need to raise money for the rest of the year, despite skepticism from some investors and analysts. Tesla has been known to spend cash quickly and post consistent losses in the 15 years since its founding.

The company posted an adjusted loss of $3.35 per share on revenue of $3.41 billion during the first quarter. Analysts had predicted an adjusted loss of $3.42 per share on revenue of $3.32 billion, according to Bloomberg.

Tesla has struggled to ramp up production for the Model 3 since its launch in July. During the fourth quarter of 2017, Tesla made 2,425 Model 3 vehicles. The company made 9,766 Model 3s in the first quarter of this year but missed its goal of producing 2,500 a week by the end of the quarter, making 2,020 Model 3s in the final week.

During Tesla's annual shareholder meeting on June 5, Musk said the company had demonstrated the ability to make 3,500 Model 3s a week and was on track to hit its goal of 5,000 a week by the end of the month.

In his email on Tuesday, Musk also said the company would not renew its agreement with Home Depot to sell solar panels and battery packs at the retailer's stores. Musk said most Tesla employees who had worked at the Home Depot displays would be allowed to move to Tesla's stores.

You can read Musk's full email below:

As described previously, we are conducting a comprehensive organizational restructuring across our whole company. Tesla has grown and evolved rapidly over the past several years, which has resulted in some duplication of roles and some job functions that, while they made sense in the past, are difficult to justify today.

As part of this effort, and the need to reduce costs and become profitable, we have made the difficult decision to let go of approximately 9% of our colleagues across the company. These cuts were almost entirely made from our salaried population and no production associates were included, so this will not affect our ability to reach Model 3 production targets in the coming months.

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. 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.

This week, we are informing those whose roles are impacted by this action. We made these decisions by evaluating the criticality of each position, whether certain jobs could be done more efficiently and productively, and by assessing the specific skills and abilities of each individual in the company. As you know, we are also continuing to flatten our management structure to help us communicate better, eliminate bureaucracy and move faster.

In addition to this company-wide restructuring, we've decided not to renew our residential sales agreement with Home Depot in order to focus our efforts on selling solar power in Tesla stores and online. The majority of Tesla employees working at Home Depot will be offered the opportunity to move over to Tesla retail locations.

I would like to thank everyone who is departing Tesla for their hard work over the years. I'm deeply grateful for your many contributions to our mission. It is very difficult to say goodbye. In order to minimize the impact, Tesla is providing significant salary and stock vesting (proportionate to length of service) to those we are letting go.

To be clear, Tesla will still continue to hire outstanding talent in critical roles as we move forward and there is still a significant need for additional production personnel. I also want to emphasize that we are making this hard decision now so that we never have to do this again.

To those who are departing, thank you for everything you've done for Tesla and we wish you well in your future opportunities. To those remaining, I would like to thank you in advance for the difficult job that remains ahead. We are a small company in one of the toughest and most competitive industries on Earth, where just staying alive, let alone growing, is a form of victory (Tesla and Ford remain the only American car companies who haven't gone bankrupt). Yet, despite our tiny size, Tesla has already played a major role in moving the auto industry towards sustainable electric transport and moving the energy industry towards sustainable power generation and storage. We must continue to drive that forward for the good of the world.

Thanks,

Elon

If you've worked for Tesla and have a story to share, you can contact this reporter at mmatousek@businessinsider.com.