The daring attempt by billionaire Elon Musk’s SpaceX to land the first stage of an umanned rocket on a floating platform in the Pacific Ocean came close but ultimately fell short when one of the landing legs didn't operate correctly, the company said Sunday afternoon.

The launch of the Falcon 9 rocket, on a mission to deliver a government satellite to orbit, was successful. But while the booster stage hit the platform softly, it fell over when one of the landing legs didn't lock in place correctly, the company said.

The attempt to land at sea came a month after the space company landed the first stage of its rocket on a landing pad at Cape Canaveral.

The rocked lifted off at 1:42 p.m. Eastern time from Vandenberg Air Force Base in California, and it successfully delivered into orbit a government satellite that would monitor sea levels. But many were watching the event for what would happen after liftoff.

Once it powered the rocket into space, the booster stage of the Falcon 9 rocket separated, turned around and headed back toward Earth, using its engine thrust to slow down, just as it did last month. But this time, the rocket aimed for what Musk calls an “autonomous spaceport drone ship,” a platform 200 miles off the California coast that is about the size of a football field.

“Unfortunately, we are not standing upright on the drone ship at the moment,” said John Federspiel, a SpaceX engineer who served as broadcaster during a live Web broadcast. But he said the rocket did hit the target, albeit too hard.

Before the launch, a company official on the broadcast said that there were 15- to 20-foot waves, which would make the landing “dicey,” and that it is “a lot more challenging to land on a moving sea platform” than on land.

Musk also tweeted that the tight and moving landing spot wasn't the problem. "Touchdown speed was ok," he tweeted, "but a leg lockout didn't latch, so it tipped over after landing."

Musk, like others, is working to recover the rockets in an attempt to lower the cost of space travel, so that it can become more accessible to the masses. Typically, the rocket first stages, the most expensive part of the rocket, are discarded into the ocean after each flight.

Being able to land and reuse them could, Musk and others think, make space flight much more affordable. SpaceX took a significant step in that direction when it landed its rocket last month. On Friday evening, it successfully re-fired the engines of that rocket, which showed that they could perform again — though Musk has said that he intends to preserve the first stage as a historic artifact instead of flying it again.

“Conducted hold-down firing of returned Falcon rocket,” Musk tweeted Friday. “Data looks good overall, but engine 9 showed thrust fluctuations.”

Jeff Bezos, founder of and owner of a space company, tweeted a congratulations to SpaceX in what appeared to be a peace offering between the two billionaires-turned-space-rivals. After Bezos's Blue Origin landed its suborbital rocket in November, Musk played down the achievement and said it wasn't nearly as audacious as what SpaceX was attempting: the landing of a much bigger and powerful booster designed to send its payload to orbit — and not just past the edge of space.

Then, when Musk pulled off the landing at Cape Canaveral last month, Bezos, who owns The Washington Post, appeared to needle him, saying on Twitter that Blue Origin was first: "Congrats @SpaceX on landing Falcon's suborbital booster stage. Welcome to the club!"

But on Sunday, he tweeted:

While SpaceX has built a massive landing pad at Cape Canaveral, it would still need to land at sea for “high velocity missions,” Musk said on Twitter. The company is developing a Falcon Heavy rocket, which would be bigger and more powerful than the Falcon 9.

Company officials also said that while it is building a landing site at Vandenberg, it had not yet secured the environmental approvals to attempt landings there.

Last year, SpaceX tried twice to land on the drone ship. In both attempts, the rockets hit the platform, but they came down too hard or at a slight angle, tipped over and exploded.

The satellite launched Sunday is called Jason-3, which would help the National Oceanic Atmospheric Administration and a U.S.-European coalition of scientists to monitor sea levels and forecast hurricane intensities and tides for commercial shipping.

The satellite would also help scientists understand the effects of climate change on ocean levels.