A SpaceX Falcon 9 rocket carrying two veteran NASA astronauts lifted off for the International Space Station on Saturday, the first crewed space flight from US soil in nine years and the first ever by a commercial company.

The two-stage rocket with astronauts Robert Behnken and Douglas Hurley aboard blasted off smoothly in a cloud of orange flames and smoke from Launch Pad 39A at Florida's Kennedy Space Center for a historic flight to the orbiting ISS.

"Let's light this candle," Hurley said, right before liftoff.

The reusable first booster stage of the SpaceX rocket separated cleanly about two and a half minutes after liftoff and landed upright on a floating barge off the Atlantic coast.

The second stage also separated smoothly, sending the astronauts in the Crew Dragon capsule on their way to the space station.

SpaceX said Crew Dragon was on the correct trajectory to link up with the space station orbiting some 250 miles (450 kilometers) above the Earth.

NASA astronauts Bob Behnken (L) and Doug Hurley (R) are strapped in the SpaceX Crew Dragon capsule / © NASA TV/AFP

The launch had originally been scheduled for Wednesday but was delayed because of weather conditions, which also remained uncertain on Saturday right up until liftoff at 3:22 pm (1922 GMT).

President Donald Trump flew to Florida aboard Air Force One to watch the launch and described it as "really something special."

"Real talent, real genius, nobody does it like us," said Trump, who has vowed to send astronauts back to the Moon by 2024.

The SpaceX launch is the first of American astronauts from US soil since the space shuttle program ended in 2011 and California-based SpaceX, founded by entrepreneur Elon Musk, is the first private company to send astronauts into space.

NASA's first crewed mission in nine years / © AFP

The mission, dubbed "Demo-2," is the final test flight before NASA certifies SpaceX's Crew Dragon capsule for regular crewed missions.

Behnken, 49, and Hurley, 53, former military test pilots who joined the US space agency in 2000, blasted off from Launch Pad 39A.

The same launch pad was used by Neil Armstrong on Apollo 11's landmark 1969 journey to the Moon, and NASA is seeking to revive excitement around human space exploration ahead of a planned return to Earth's satellite and then Mars.

- Defining moment for SpaceX -

The Crew Dragon capsule atop SpaceX's Falcon 9 rocket / © GETTY IMAGES/AFP

Behnken and Hurley went through the same preparations Saturday that they went through on Wednesday.

They donned their futuristic SpaceX-designed spacesuits four hours before launch and exchanged final words with NASA chief Jim Bridenstine, who was wearing a mask because of the coronavirus pandemic.

After saying goodbye to their wives -- both former astronauts -- and children they were driven to the launch pad in a white electric car built by Tesla, one of Musk's other companies.

The hatch on the rocket's Crew Dragon capsule was closed about two hours before blastoff followed by the arming of the emergency escape system.

The mission comes despite nationwide shutdowns caused by the coronavirus crisis and protests in several US cities over the death of a black man in Minneapolis while he was being arrested by a white police officer.

Behnken and Hurley, veterans of two space shuttle missions each, were in quarantine for more than two weeks and were regularly tested for COVID-19.

NASA had urged crowds to stay away from Cocoa Beach, the traditional viewing spot -- but that did not discourage space fans from gathering for Saturday's launch.

NASA has had to pay Russia for its Soyuz rockets to take US astronauts to space ever since the shuttle program ended.

The Crew Dragon mission is a defining moment for SpaceX, which Musk founded in 2002 with the goal of producing a lower-cost alternative to human spaceflight.

By 2012, it had become the first private company to dock a cargo capsule at the ISS, resupplying the station regularly ever since.

The US space agency paid more than $3 billion for SpaceX to design, build, test and operate its reusable Dragon capsule for six future space round-trips.

SpaceX conducted a successful test flight of Crew Dragon to the ISS in March 2019 with a sensor-laden mannequin on board named Ripley, after the character played by Sigourney Weaver in the "Alien" movies.

SpaceX founder Elon Musk / © GETTY IMAGES/AFP

The project has experienced delays, explosions, and parachute problems -- but even so, SpaceX has beaten its giant competitor Boeing to the punch.

Crew Dragon is scheduled to dock with the ISS about 19 hours after liftoff, for a duration that is yet to be finalized, but likely until early August.

Wednesday's flight was scrubbed 17 minutes before blastoff because of high levels of atmospheric electricity that could have triggered a lightning strike on the rocket.

With Behnken and Hurley strapped into the Crew Dragon capsule, the launch pad platform retracted and rocket fueling underway, SpaceX and NASA made the call to abort.