CAPE CANAVERAL, Fla. -- A massive fireball and explosion erupted Thursday at SpaceX's main launch pad, destroying a rocket as well as a satellite that Facebook was counting on to spread internet service in Africa.

There were no injuries. The pad had been cleared of workers before what was supposed to be a routine pre-launch rocket engine test.

SpaceX chief Elon Musk said the accident occurred while the rocket was being fueled and originated around the upper-stage oxygen tank.

"Cause still unknown," Musk said via Twitter. "More soon."

The explosion -- heard and felt for miles around -- dealt a severe blow to SpaceX, still scrambling to catch up with satellite deliveries following a launch accident last year. It's also a setback for NASA, which has been relying on the private space company to keep the International Space Station stocked with supplies and, ultimately, astronauts.

SpaceX was preparing for the test firing of its unmanned Falcon rocket when the blast happened shortly after 9 a.m. at Cape Canaveral Air Force Station. The test was in advance of Saturday's planned launch of an Israeli-made communications satellite to provide home internet for parts of sub-Saharan Africa, the Middle East and Europe.

A video of the explosion shows a fireball enveloping the top of the rocket. Moments later, the nose cone containing the satellite plunged to the ground, followed by more explosions.

Buildings four miles away shook from the blast, and a series of explosions continued for several minutes. Dark smoke filled the overcast sky. A half-hour later, a black cloud hung low across the eastern horizon.

Video cameras showed smoke coming from the restricted site well into late afternoon. Most of the rocket was still standing, although the top third or so was clearly bent over.

The explosion occurred at Launch Complex 40 at the Air Force station, right next door to NASA's Kennedy Space Center, where emergency staff went on standby and monitored the air for any toxic fumes. The initial blast sent NASA employees rushing outside to see what happened. The Air Force stressed there was no threat to public safety in the surrounding communities.

While the pad was still burning, it was off-limits. "We want to make sure we isolate any potential problem," said Shawn Walleck, a spokesman for the Air Force's 45th Space Wing, "because at this point, we've had no casualties, we've had no injuries, and we want to keep it that way."

By evening the fire was out, but the pad was going to remain off-limits until Friday morning as a precaution, the Air Force said.

Facebook spokesman Chris Norton said the social media company was "disappointed by the loss, but remain committed to our mission of connecting people to the internet around the world." Founder Mark Zuckerberg was in Kenya on Thursday, discussing internet access with government officials.

The satellite's Israeli-based operator, Spacecom, said the loss will have "a significant impact" on the company. Just last November, ground controllers lost contact with the previous satellite in this so-called Amos series. The new satellite was supposed to provide services to television and internet operators and a number of clients, including Facebook.

The Falcon rocket destroyed Thursday is the same kind used to launch space station supplies. The last such flight took place in July. SpaceX, one of two companies making deliveries, is also working on a crew capsule to ferry station U.S. astronauts.

Two NASA astronauts were doing a spacewalk 250 miles up, outside the space station, when the explosion occurred. Mission Control did not tell them about the accident, saying all communication was focused on the spacewalk.

NASA later put out a statement, saying the space agency remains confident in its commercial partners, SpaceX included. The space station is well stocked and able to weather any potential delays to upcoming SpaceX deliveries, NASA said.

At the same time, NASA said it remains on track for next Thursday's launch of an asteroid-chasing and sampling spacecraft, the first of its kind for the U.S. The spacecraft and the Atlas rocket were inside their hangar at the time of the explosion, barely a mile away; preliminary inspections show both to be in good shape.

The California-based SpaceX had been ramping up with frequent launches to make up for a backlog created by a launch accident in June 2015. In that mishap, a support strut evidently snapped in the upper stage; the problem was fixed.

Until Thursday, the company had successfully carried out eight launches this year, with nine more in the wings by year's end, including the debut flight of the so-called Falcon Heavy. Now that lineup is in jeopardy.

SpaceX is leasing the Cape Canaveral pad from the Air Force for unmanned Falcon launches. The company is also redoing a former shuttle pad at Kennedy for future manned flights for NASA. The first crewed flight was supposed to take place by the end of next year. Boeing also is developing a crew capsule for NASA.

Even before Thursday's accident, NASA's inspector general office was skeptical there would be astronaut flights by SpaceX or Boeing before late 2018. Technical challenges are piling up and threaten to cause delays, according to a report issued Thursday.

Sen. Bill Nelson, D-Fla., whose single space shuttle flight ended 10 days before the Challenger disaster in 1986, said in a statement that the SpaceX accident "reminds us all that space flight is an inherently risky business."

Others also rallied behind SpaceX, including Rep. Lamar Smith, R-Texas, chairman of the House Science, Space and Technology Committee. "Despite the difficulties, commercial spaceflight will carry on with American drive and ingenuity," he said in a statement.

AP writers Rodney Muhumuza in Kampala, Uganda, and Daniel Estrin in Jerusalem contributed to this report.