SpaceX President and COO Gwynne Shotwell and CEO Elon Musk choked up breaking bad news about layoffs at an all-hands meeting in Hawthorne, California, last Friday, according to three people who attended or viewed the meeting via video.

Musk and Shotwell acknowledged that the broad restructuring at SpaceX meant the company would have to lay off some employees with whom they’d rather not part ways. The company still employs about 6,400 people, according to two people who were laid off.

In a statement, SpaceX said: “To continue delivering for our customers and to succeed in developing interplanetary spacecraft and a global space-based Internet, SpaceX must become a leaner company.”

The layoffs come as SpaceX is gunning to become a powerhouse in telecommunications and transforming the business of aerospace with promises of re-usable rockets and engines. It is in the midst of raising a targeted $500 million round of venture funding that would value the company at $30.5 billion, making it one of the most valuable start-ups in the world. The company is aiming to run its first cargo mission to Mars by 2022, and to send humans there in a 2024 mission.

On Friday, the company told employees to go home and check their inboxes to learn if they were personally getting a pink slip, and said that SpaceX would be closed over the weekend. Attendance at all-hands meetings is not required at SpaceX, so some people first learned about the layoffs through a company-wide email.

The company emailed separation agreements starting on Friday evening, and offered employees assistance with resume-writing and job searches, among other severance benefits.

Two terminated employees said the layoffs appeared to be throughout the organization, and no single team or region was disproportionately affected or eliminated.

SpaceX confirmed that it still employed more than 6,000 and that the workforce reduction applied across all teams.

According to a WARN notice filed with the state of California on January 11th, the company let go of 577 employees at its Hawthorne facility alone, where SpaceX is focused on developing its re-usable Raptor engines to power its massive rockets. Employees at other SpaceX facilities were also laid off.

The workforce reduction surprised some SpaceX insiders, but others suspected it was coming, these people said.

In May 2018, Shotwell told CNBC’s Morgan Brennan that SpaceX was profitable despite “financially rough years” — such as when one of its Falcon 9 rockets exploded in 2016. Shotwell said at that time that SpaceX was “raising funding kind of bit by bit…. We’re being very picky about who invests in the company. They have to share our long term vision.”

Demand for SpaceX launch and telecommunication services is high. Increasingly, startups are launching small satellites to gather data and aerial images of the Earth. Other businesses are launching or maintaining satellite constellations to deliver internet and broadcast services to people where ground-based systems aren’t installed, or aren’t effective.

SpaceX is developing its own satellite constellation, Starlink, which would put thousands of low-cost satellites into low-Earth orbit and cover the planet with internet services. SpaceX is also building a massive new Starship and Raptor engines to transport people and cargo to other planets. Musk has said he wants SpaceX to enable the colonization of Mars.

The layoffs were tempered by a technical triumph for the company. Over the weekend, SpaceX Dragon returned safely from a mission to bring supplies to the International Space Station, and research and data back down to scientists on earth, according to a NASA statement. The completion of this mission marked the “first nighttime splashdown and recovery for the Dragon.” In other words, SpaceX can land its re-usable spacecraft in the middle of the ocean in the dark — in the middle of a broad restructuring.

Here’s SpaceX’s full statement on the layoffs:

“To continue delivering for our customers and to succeed in developing interplanetary spacecraft and a global space-based Internet, SpaceX must become a leaner company. Either of these developments, even when attempted separately, have bankrupted other organizations. This means we must part ways with some talented and hardworking members of our team. We are grateful for everything they have accomplished and their commitment to SpaceX’s mission. This action is taken only due to the extraordinarily difficult challenges ahead and would not otherwise be necessary.”