On Sunday morning, SpaceX successfully launched one of its last big flight tests for NASA, a launch that could pave the way for the company to carry passengers into space later this year. The flight tested the emergency escape system on the company’s new passenger spacecraft, and SpaceX destroyed one of its Falcon 9 rockets in the process — on purpose.

SpaceX was testing its new Crew Dragon capsule, a passenger spacecraft the company is developing for NASA’s Commercial Crew program. This weekend’s test, known as an in-flight abort test, helped to ensure that the Crew Dragon can keep its crew safe in the unlikely event of an emergency, a requirement before NASA will allow astronauts to fly on it. SpaceX mimicked a failed rocket launch, to show that its Crew Dragon can survive and protect its precious inhabitants inside.

Early analysis of the test flight indicated that everything went according to plan. “As far as we can tell, it was a picture-perfect mission,” said SpaceX CEO Elon Musk in a press conference following the test.

“We want to practice, practice, practice.”

The Crew Dragon’s escape system is made up of eight SuperDraco engines, embedded in the outer hull of the capsule. These small thrusters are designed to fire if the Falcon 9 rocket carrying the capsule suffers a major failure during flight. The SuperDracos can propel the spacecraft up and away from the decaying rocket. Once the Crew Dragon is at a safe distance, the capsule can deploy its four main parachutes and lower itself gently into the Atlantic Ocean. A recovery boat would then meet up with the capsule and rescue the crew inside.

SpaceX has tested out this escape system before, but only when the Crew Dragon was on the ground. The company and NASA wanted to see this process in action while the capsule is zooming into the sky on top of a rocket. That’s when the system will be needed most if a worst-case scenario happens in the future.

At 10:30AM ET on Sunday from Cape Canaveral, Florida, SpaceX launched one of its used Falcon 9 rockets — which has been to space and back three times before — with a Crew Dragon on top. At 84 seconds after launch, when the rocket and capsule were feeling the most stress during flight, the SuperDracos fired and the rocket’s main engines cut off. The Crew Dragon then went through the entire escape routine and successfully splashed down in the Atlantic Ocean as planned.

Thanks to the SuperDracos, the Crew Dragon traveled up to a mile away from the Falcon 9 it was flying on. The capsule reached twice the speed of sound during the test and reached a peak altitude of 131,000 feet, pulling up to 3.5 Gs at one point during the test. There were no people on board during this flight, though SpaceX did have two smart dummies inside the Crew Dragon to help gather data about how the maneuver would affect future crew members. Both the dummies and vehicle were recovered by boat following the splashdown.

SpaceX expected to lose its Falcon 9 rocket during this test, and the vehicle burst into flames shortly after the Crew Dragon separated from the rocket. The rocket was fully fueled for this launch, causing the propellant to light up. The explosion occurred about 10 seconds after the Crew Dragon had separated from the rocket, so the capsule was a significant distance away at that point.

But Musk said the Crew Dragon could have survived if it had been right on top of the fireball. “Since the spacecraft has a very powerful base heat shield, it should not really be significantly affected by the fireball,” Musk said. “It could quite literally look like something out of Star Wars, where it flies right out of the fireball.” Musk also noted that the Crew Dragon could do an escape like at any point during the climb to space, right up until it’s deployed into orbit.

With this test now complete, the next big flight of the Crew Dragon will have people on board

With this test now complete, the next big flight of the Crew Dragon will have people on board: NASA astronauts Bob Behnken and Doug Hurley. The pair watched the launch from Florida today, as did their families.

“Our families were certainly watching from back home. Obviously, they’re keenly interested in those kinds of things,” Hurley said in a press conference after the launch. “You have a whole bunch of different things that go through your mind, emotions that you experience during a launch. This is a key one leading up to our launch, so I think that part of it is pretty exciting.”

The date of Behnken and Hurley’s highly anticipated trip is still very much an open question, though. The Crew Dragon that will be used for that test is slated to be ready by the end of the February, according to Musk. And after the in-flight abort, SpaceX and NASA will need to review all the data and do additional paperwork, and SpaceX still has to do some more tests of its parachutes, which it upgraded last year. The company also has to accommodate other flights that are scheduled to launch to the International Space Station this year. However, Musk said that if all goes well, the first crewed flight on the Crew Dragon could take place in the second quarter of this year.

In the meantime, NASA is looking to buy an additional seat on Russia’s Soyuz rocket to make sure the space agency has continued access to the space station. Since the retirement of the Space Shuttle in 2011, NASA has had to rely on Russia to transport the agency’s astronauts to and from the ISS. The Commercial Crew program is meant to return human spaceflight to the US, but until the vehicles are ready, NASA must rely on the Soyuz for a little while longer.

Despite that reality, both NASA and SpaceX are getting excited about the prospect of finally flying people this year from Florida. “Anyone who has an adventurous bone in their body is going to be very excited about this,” said Musk.

Update January 19th, 1:30PM ET: This article was updated several times to indicate changes in launch time and finally a successful test. Additional information was added from a NASA press conference.