The force of the blast shook buildings several miles away.
SpaceX said "an anomaly" had occurred while the rocket was being loaded with fuel. No-one was injured, it said.
The rocket's payload, an  Israeli-built communications satellite for Facebook due to launch on Saturday, was also destroyed, it added.
Facebook, in partnership with Eutelsat Communications, had been due to use the Amos-6 satellite to deliver broadband internet coverage for swathes of sub-Saharan Africa as part of its Internet.org initiative.
Facebook founder Mark Zuckerberg, who is currently visiting Africa, said he was "deeply disappointed" to hear that the satellite had been destroyed.
"We remain committed to our mission of connecting everyone, and we will keep working until everyone has the opportunities this satellite would have provided," he wrote on his Facebook account.
A leading Israeli space official said the loss of the Amos-6 satellite, valued at more than $200m (Â£150m) and owned by Spacecom, was a major blow to the industry.
"As far as the Israeli communications satellite industry is concerned, this is a very severe blow which could place the future of the industry in doubt if it is not dragged out of the mud," said the chairman of the  Israel Space Agency, Isaac Ben-Israel.
SpaceX rocket explodes on launch pad
Cape Canaveral Air Force Station said a "significant" explosion had happened just after 09:00 (14:00 GMT) at Launch Complex 40, which is leased by SpaceX.
SpaceX said in a statement: "The anomaly originated around the upper stage oxygen tanks and occurred during propellant loading of the vehicle.
A history of SpaceX in pictures
"As per standard operating procedure, all personnel were clear of the pad and no-one was injured. We are continuing to review the data to identify the root cause."
SpaceX is aiming to create a new era of reusable rockets and affordable private space travel and has used its Falcon-9 rocket to take supplies to the International Space Station (ISS).
In December last year, the California-based company successfully landed a Falcon-9 back on Earth after a mission to launch orbiting satellites - a first in rocketry.
SpaceX is run out of Hawthorne near Los Angeles by Elon Musk, who made his fortune with internet companies.
As well as being the rocket company's CEO, he also heads up the Tesla electric car company.
Whatever the details of what went wrong at the launch-pad, this is bad news for one of the most ambitious-ever space programmes.
SpaceX has big dreams for cheap, frequent and distant space travel. This test-firing was meant to be routine, part of an accelerating series of launches.
Beyond it, SpaceX is looking to make history by re-using one of the massive first stages that was returned to Earth intact. The company is also preparing to fly astronauts to the International Space Station.
Most exotic of all, the company's boss, Elon Musk, is due later this month to unveil his plans for a Mars colony, and how that would take effect.
There had been talk of the first SpaceX unmanned mission to the Red Planet in a couple of years' time. All its timetables will now be in jeopardy.

Edison Cavani opened the scoring from the penalty spot on Saturday, with 18-year-old Jonathan Ikone doubling PSG's lead before half-time.
Lucas Moura and teenager Odsonne Edouard completed the rout in the second half at the StubHubCenter.
The Foxes face Barcelona next in the competition in Stockholm on Wednesday.
Claudio Ranieri's side, who start their Premier League campaign at Hull City on 13 August, beat Celtic 6-5 on penalties in their first International Champions Cup game last week.
Subscribe to the BBC Sport newsletter to get our pick of news, features and video sent to your inbox.
A rocket operated by the aerospace company SpaceX has exploded on the launch pad at Cape Canaveral where it was being test-fired ahead of a launch.
[NEXT_CONCEPT]
Premier League winners Leicester City suffered a 4-0 loss to French champions Paris St-Germain in the International Champions Cup in Los Angeles.