After flying to the edge of space, a spent SpaceX Falcon 9 rocket booster successfully returned to Earth, deployed its landing legs, and hovered for a moment. The ability, known as a soft landing, could allow the company to dramatically reduce the cost of spaceflight and one day land rockets on Mars.

Because it came down at a spot in the Atlantic Ocean, SpaceX's rocket had nothing solid to land on. It crashed into the ocean and was lost to large waves from a storm before the company could get a boat out to recover it. But in the next few months, SpaceX hopes to reproduce the achievement.

"We expect to get more and more precise with each landing. If all goes well, I am optimistic that we can land a stage back at Cape Canaveral at the end of the year," said entrepreneur and SpaceX founder Elon Musk, during a press conference Apr. 25 in Washington D.C.

Soft landing a rocket is something that Musk and SpaceX have been working towards since the company's inception. After burning through their fuel, today's rocket stages simply crash into the ocean and are lost. Each new launch requires building a brand new rocket. By recovering the spent stages, SpaceX predicts it could reduce the cost of their launches, currently around $60 million per flight, by as much as 70 percent. Musk hopes that in the future the company would be able to fly a rocket stage to space, bring it back to a launch pad on the ground, refurbish and refuel it, and potentially fly it again the same day. Their goal is to eventually bring the cost of a single launch down to between $5 and $7 million.

Though unstated at the press conference, this technology is also a first step in setting SpaceX up for one of Musk's long-term stated desires: placing a human on Mars. Though NASA was able to put the 1-ton Curiosity rover on the Red Planet's surface in 2012, we currently lack the capability to land anything heavier. A human mission to Mars could require landing as much as 40 tons of material on the surface, an impossible task with today's technology.

The problem is that Mars' thin atmosphere prevents parachutes from inflating enough to slow a lander down. But a technology called supersonic retropropulsion would allow a rocket to fire its engines downward to slow and hover above the ground before landing. NASA has made some strides toward testing and building this technology but is far from making it practical. By achieving a soft landing on Earth, SpaceX has shown itself capable of one day developing similar technology for a Mars landing.

At the press conference, Musk said that the Falcon 9 rocket stage came down within a few miles of its intended target. With better accuracy, SpaceX wants to bring this precision to within a mile. Eventually, the company "should be able to land with the accuracy of a helicopter," said Musk, achieving a precision "within a meter of its target."

Below you can watch a video of earlier testing of the rocket stage, showing it flying up to 820 feet and landing directly on a target.