In this May 7, 2018, file photo, Elon Musk attends The Metropolitan Museum of Art's Costume Institute benefit gala celebrating the opening of the Heavenly Bodies: Fashion and the Catholic Imagination exhibition in New York. Tesla Inc. is laying off about 3,600 white-collar workers as it slashes costs in an effort to become profitable. Musk says in an e-mail to workers Tuesday, June 12, 2018, that the cuts amount to about 9 percent of the company’s workforce of 40,000. Credit: Charles Sykes/Invision/AP

Tesla announced Tuesday it planned to lay off up to nine percent of its workforce, a move that could eliminate roughly 3,700 employees.

In a company-wide email, chief executive Elon Musk described the decision as “restructuring” and said it would affect only salaried employees – not the factory workers building its next fleet of Model 3 electric cars.

“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,” Musk wrote.

The cuts come as the company aims to shrink costs and become profitable, Musk said.

Analysts have lately argued that Tesla, which has attracted negative headlines for months, had finally turned a corner.

Last week, Musk easily overcame an attempt to strip him of his role as chairman of Tesla’s board, a controversial plan introduced by a company shareholder who raised doubts about Musk’s ability to manage multiple companies simultaneously.

Afterward an emotional Musk appeared to signal brighter days ahead for the Tesla when he predicted the company would begin pushing out 5,000 Model 3s per week by the end of June.

He also predicted Tesla would be profitable in Q3 and Q4.

“One of the biggest mistakes we made was trying to automate things that are super easy for a person to do, but super hard for a robot to do,” he said.

Tesla has struggled in recent months to resolve nagging production issues surrounding the Model 3 roll-out.

Despite glowing reviews and a cult-like following of eager buyers, new Model 3s have trickled out of Tesla’s factories months behind schedule. The company has also been pushed back against accusations of poor worker safety and discrimination at company facilities, and headline-grabbing wrecks and investigations that have raised questions about the company’s semi autonomous technology.

Follow the Bangor Daily News on Facebook for the latest Maine news.