A prototype of the future giant SpaceX rocket Starship - which the company hopes will become its go-to for Mars missions - crashed in a fiery explosion during a test launch along the Texas coast Wednesday.

But the company line was upbeat as a livestream of the launch displayed the on-screen message "AWESOME TEST. CONGRATS STARSHIP TEAM!"

"Mars, here we come!!" SpaceX founder Tesla's Elon Musk tweeted just minutes after the flight, explaining that a too-fast landing speed was to blame for the crash.

He recounted the successful parts of the rocket's short late afternoon trip: the take-off, the change of position in flight and its (pre-explosion) precise landing trajectory.

"We got all the data we needed! Congrats SpaceX team," he tweeted.

Wednesday's test launch took off and ascended properly in a seemingly straight line, before one and then another of its engines went out. After 4 minutes and 45 seconds of flight, its third engine extinguished and the rocket began its descent in its expected position.

The engines were restarted just seconds before landing in an effort to slow the ship, but it crashed hard into the Earth.

Smaller prototypes have already blasted off several hundred yards (meters) into the air for less than a minute as part of a series of tests aimed at developing the next generation of rockets from the company at lightening speed.

'Success'

After several aborted attempts this week, the flight was livestreamed on the @SpaceX Twitter account.

The test flight was planned to check the huge metal body of SN8 (Starship number 8) and its three engines for their aerodynamism, including during the ship's return to Earth - which happens vertically, in the same vein as SpaceX's pioneering Falcon 9 rocket.

"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," a statement on the company's website said, implying even before the launch that an explosion or crash would not mean a failed mission.

Construction on SN9, the next prototype, is already almost finished.

The experimental flights are taking place in a nearly deserted part of southern Texas on the Gulf of Mexico near the US-Mexican border - an area empty enough that any flight malfunction would be unlikely to cause physical or property damage.

Musk recently announced he plans to move to the vast southern US state from California.

Any future completed Starship rocket will be equipped with 37 engines instead of nine, and will measure 120 meters (390 feet) tall and be capable of carrying 100 tons of cargo into orbit around the Earth.

Musk hopes to be able to one day launch several of these space ships to Mars, though they could prove useful even in the short term as NASA eyes re-establishing an ongoing presence on the Moon in 2024.

Japanese billionaire Yusaku Maezawa is currently scheduled to pay an undisclosed sum to take Starship for a spin around the Moon in 2023 - at the earliest.

© Agence France-Presse