SpaceX鈥檚 mega Starship rocket completed its first full test flight Thursday, returning to Earth without exploding after blasting off from Texas.

It was the fourth test flight for the world鈥檚 biggest and most powerful rocket, standing nearly 400 feet (121 metres) tall. Three previous tests ended in explosions. This time, the rocket and the spacecraft managed to splash down in a controlled fashion, making the hourlong flight the longest and most successful yet.

Starship was empty as it soared above the Gulf of Mexico and headed east on a flight to the Indian Ocean. Minutes after liftoff, the first-stage booster separated from the spacecraft and splashed into the gulf precisely as planned, after firing its engines.

An hour later, live views showed parts of the spacecraft breaking away during the intense heat of reentry, but it remained intact enough to transmit data all the way to its targeted splashdown site in the Indian Ocean.

鈥淒espite loss of many tiles and a damaged flap, Starship made it all the way to a soft landing in the ocean!鈥 SpaceX CEO Elon Musk said via X.

It was a critical milestone in the company鈥檚 plan to eventually reuse the rocket that NASA and Musk are counting on to get humanity to the moon and then Mars.

SpaceX came close to avoiding explosions in March, but lost contact with the spacecraft as it careened out of space and blew up short of its goal. The booster also ruptured in flight, a quarter-mile above the gulf.

Last year鈥檚 two test flights ended in explosions shortly after blasting off from the southern tip of Texas near the Mexican border. The first one cratered the pad at Boca Chica Beach and hurled debris for thousands of feet (metres).

SpaceX upgraded the software and made some rocket-flyback changes to improve the odds. The U.S. Federal Aviation Administration signed off Tuesday on this fourth demo, saying all safety requirements had been met.

Starship is designed to be fully reusable. That鈥檚 why SpaceX wants to control the booster鈥檚 entry into the gulf and the spacecraft鈥檚 descent into the Indian Ocean 鈥 it鈥檚 intended as practice for planned future landings. Nothing is being recovered from Thursday鈥檚 flight.

NASA has ordered a pair of Starships for two moon-landing missions by astronauts, on tap for later this decade. Each moon crew will rely on NASA鈥檚 own rocket and capsule to leave Earth, but meet up with Starship in lunar orbit for the ride down to the surface.

SpaceX already is selling tourist trips around the moon. The first private lunar customer, a Japanese tycoon, pulled out of the trip with his entourage last week, citing the oft-delayed schedule.

SpaceX鈥檚 founder and CEO has grander plans: Musk envisions fleets of Starships launching people and the infrastructure necessary to build a city on Mars.

The Associated Press Health and Science Department receives support from the Howard Hughes Medical Institute鈥檚 Science and Educational Media Group. The AP is solely responsible for all content.