Elon Musk's SpaceX Starship SN8 rocket explodes into fireball while trying to land

SpaceX's latest test flight has ended in a fireball.

The Starship SN8 prototype, which one day SpaceX hopes will take people to Mars, hit the ground and exploded whilst trying to land at the company's Boca Chica site in Texas on Thursday (NZ time). 

Video shows the spacecraft attempting to perform a landing flip - a "first for a vehicle of this size" - waiting until the final seconds of the seven-minute flight to manoeuvre into its upright landing posture. But it's still moving too quickly, and explodes the second it touches the ground.

Before the launch, SpaceX said the primary objective was to learn - not necessarily succeed.

"With a test such as this, success is not measured by completion of specific objectives but rather how much we can learn, which will inform and improve the probability of success in the future as SpaceX rapidly advances development of Starship," it said in a statement.

SpaceX boss Elon Musk was upbeat, despite losing the prototype ship - focusing on the positives.

"Successful ascent, switchover to header tanks & precise flap control to landing point!" he tweeted. 

Astronomer and author Phil Plait said "right up until it hit the ground a bit faster than planned it looked like it was doing well".

"One Raptor engine shut down during ascent, but I don't know if that was on purpose as part of the test or if it was a malfunction of some kind. I imagine we'll be hearing from SpaceX about it."

A test flight of the SN8 was scrapped just two seconds before liftoff a day earlier, when something abnormal was detected in one of the Raptor engines. 

"Musk tweeted that a lot of this went well, including altitude control using the flaps," wrote Plait. "That's critical, given that nothing like this vertical-to-belly-flop-to-vertical has ever been done before. Be curious to hear about the engines and what happened at landing."

SpaceX has nine more Starships to run tests on. 

Despite how the test ended, Musk remained optimistic.

"Mars, here we come!!" he tweeted.