Nobody was injured.
The test flight involved a three-engine version of the company's reusable Falcon 9 rocket, spokesman John Taylor said in a statement. SpaceX has been using the Falcon 9 to launch satellites and the Dragon spacecraft, which delivers cargo to the International Space Station.
But this experimental version of the Falcon 9 has fewer engines and is designed to lift off and land vertically on four legs.
"During the flight, an anomaly was detected in the vehicle and the flight termination system automatically terminated the mission," Taylor said.
"Throughout the test and subsequent flight termination, the vehicle remained in the designated flight area. There were no injuries or near injuries," he said.
A representative of the Federal Aviation Administration was present for the flight.
The company offered no further details on the nature of the "anomaly."
"With research and development projects, detecting vehicle anomalies during the testing is the purpose of the program. Today's test was particularly complex, pushing the limits of the vehicle further than any previous test," Taylor said.
SpaceX will review the flight record to learn more about the rocket's performance before its next test flight, he said.
As The Christian Science Monitor reported a major step in reducing launch costs is bringing the first stage under its own power back for refurbishment and reuse, company officials say.
SpaceX engineers have successfully put a landing system through its paces on an experimental rocket dubbed "Grasshopper" at the company's test facility at McGregor, Texas. Check out the video on Space.com.In April, SpaceX successfully tested the deployment of the Falcon 9 first stage landing legs over water. The Falcon 9 rocket was tested following the launch of the CRS-3 mission for the Dragon spacecraft, which launched from Cape Canaveral Air Force Station on April 18.
After Friday's F9R's self-detonation, SpaceX founder Elon Musk tweeted:
"Rockets are tricky ..."