There were no injuries, but the rocket and the satellite onboard were destroyed, SpaceX said in a statement.
The mishap 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 counting on the private company to keep the International Space Station stocked with supplies and, ultimately, astronauts.
SpaceX was working to conduct a test firing of its unmanned Falcon rocket when the blast occurred shortly after 9.00 AM (local time) at Cape Canaveral Air Force Station.
More From This Section
SpaceX said that in preparation for today's engine firing - a test carried out a few days before every launch - "there was an anomaly on the pad resulting in the loss of the vehicle and its payload." No additional details were provided.
It wasn't clear whether the rocket caused the problem or something else on the pad. The pad is normally cleared of workers before test firings.
It's the same kind of SpaceX rocket used to launch space station supplies for NASA.
TV cameras showed smoke coming from the launch pad three hours later. 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 Kennedy Space Center. Kennedy emergency staff was on standby following the explosion. At the same time, personnel were monitoring the air for any toxic fumes.
The initial blast sent next-door NASA employees rushing frantically outside to see what happened. At first, it sounded like lightning, but was followed by the sounds of more explosions, then more and more.
SpaceX is one of two companies shipping supplies to the International Space Station for NASA. The company also is working on a crew capsule to ferry station US astronauts; that first flight was supposed to come as early as next year.