SpaceX said on Friday that one of its test rockets blew itself up in Texas after an anomaly was detected. There were no reported injuries. (KWTX.COM)

A new test rocket manufactured by Elon Musk’s upstart space company, SpaceX, blew itself up a few hundred feet over the Texas prairie after a malfunction was detected, the company said in a statement Friday evening.

At its facility in McGregor, Tex., the company was testing a three-engine version of the F9R test vehicle, the successor to its re­usable Grasshopper rocket, which was designed to launch and then land on the same site.

“During the flight, an anomaly was detected in the vehicle and the flight termination system automatically terminated the mission,” company spokesman John Taylor said in the statement.

The rocket never veered off course, and there were no injuries or near injuries, the statement said. A representative from the Federal Aviation Administration was on site during the test flight.

The company stressed that rooting out problems like the one exposed in the flight is the purpose of the test program and said Friday’s test “was particularly complex, pushing the limits of the vehicle further than any previous test. As is our practice, the company will be reviewing the flight record details to learn more about the performance of the vehicle prior to our next test.”

The explosion comes as the company is fighting to gain a share of the market to launch national security satellites into orbit. This year, SpaceX sued the Air Force, arguing that it should be able to compete for the launches against United Launch Alliance, a joint venture of Boeing and Bethesda, Md.-based Lockheed Martin.

SpaceX also is competing for a NASA contract to launch astronauts to the International Space Station. It is unclear whether the explosion would have any affect on the awarding of that contract. NASA officials declined to comment.

The California-based firm was the first commercial enterprise to send cargo to the space station.

A video posted on the Web site of Texas news station KWTX shows what appears to be the rocket taking off, and then erupting into a fireball and a cloud of smoke.

In a tweet, Musk, the billionaire entrepreneur who founded Tesla Motors and PayPal, acknowledged the difficulties inherent in space flight: “Rockets are tricky.”