The rocket ship reached an altitude of 51 miles (82 kilometers) before beginning its gliding descent, said mission official Enrico Palermo. The craft landed on a runway minutes later.
"We made it to space!" Palermo said.
Thursday's flight takes Virgin Galactic a big step closer to turning the dream of commercial space tourism into reality. The company aims to take paying customers on the six-passenger rocket, which is about the size of an executive jet. Virgin Galactic found Richard Branson has said he wants to be one of the first on board.
Branson greeted the pilots after the test, declaring "Space is Virgin territory!"
Virgin Galactic considers 50 miles (80 kilometers) the boundary of space because it is used by the U.S. Air Force and other U.S. agencies. That's different than a long-held view that the boundary is at 62 miles (100 kilometers). Virgin Galactic CEO George Whitesides noted that recent research favors the lower altitude.
At the start of the test flight, a special jet carrying the Virgin Space Ship Unity climbed to an altitude near 43,000 feet (13,100 meters) before releasing the craft. The spaceship ignited its rocket engine and it quickly hurtled upward and out of sight of viewers on the ground.
The two test pilots— Mark "Forger" Stucky and former NASA astronaut Rick "CJ" Sturckow — will be awarded commercial astronaut wings, said Federal Aviation Administration official Bailey Edwards.
Virgin Galactic's development of its spaceship took far longer than expected and endured a setback when the first experimental craft broke apart during a 2014 test flight, killing the co-pilot.
More than 600 people have committed up to $250,000 for rides that include several minutes of weightlessness and a view of the Earth far below.
The endeavor began in 2004 when Branson announced the founding of Virgin Galactic in the heady days after the flights of SpaceShipOne, the first privately financed manned spacecraft that made three flights into space.