KENNEDY SPACE CENTER, Fla. — The rocket launched. It exploded.

SpaceX and NASA declared the blast a success.

Usually the destruction of a rocket means a failed mission. But on Sunday, SpaceX was demonstrating a crucial safety system of its Crew Dragon spacecraft, a capsule that is to carry astronauts for NASA to the International Space Station.

There was no one on board during Sunday’s flight. The passengers this time were two test dummies with sensors to measure the forces that real astronauts would experience if the capsule’s escape system were ever needed. The system proved itself, even during a phase of the flight when atmospheric forces on the spacecraft are most severe. About nine minutes after the test, the intact capsule landed in the Atlantic Ocean.

“Overall, as far we can tell thus far, it was a picture-perfect mission,” said Elon Musk, the founder and chief executive of SpaceX, during a news conference after the test.