Image copyright Virgin Galactic Image caption Virgin Galactic's plane will be carried to a height of 12,000m before its rocket ignites

The latest test flight by Sir Richard Branson's Virgin Galactic successfully rocketed to the edge of space and back.

The firm's SpaceShipTwo passenger rocket ship reached a height of 82.7km, beyond the altitude at which US agencies have awarded astronaut wings.

It marked the plane's fourth test flight and followed earlier setbacks in the firm's space programme.

Sir Richard is in a race with Elon Musk and Jeff Bezos to send the first fee-paying passengers into space.

He founded the commercial spaceflight company in 2004, shortly after Mr Musk started SpaceX and Jeff Bezos established Blue Origin.

In 2008, Virgin Galactic first promised sub-orbital spaceflight trips for tourists would be taking place "within 18 months". It has since regularly made similar promises to have space flights airborne in the near future.

But delays and a fatal crash in 2014 prevented Sir Richard's original ambitions.

On Thursday, the SpaceShipTwo passenger rocket ship took off from the Mojave Desert in California.

The company said the space ship's motor burned for 60 seconds, travelling at 2.9 times the speed of sound as it gained height.

The rocket carried two pilots and a mannequin named Annie as a stand-in passenger, as well as four research experiments for NASA.

"Today we have shown Virgin Galactic can open space to the world," Sir Richard said.

The US government has awarded astronaut wings to pilots who ventured farther than roughly 80km beyond earth's surface.

But Thursday's flight did not breach the 100km Karman Line, which many organisations use to resolve debates about where space begins.

While the trip marked a milestone for Virgin Galactic, the firm's rivals have already ventured farther - albeit without humans on board.

SpaceX, in partnership with NASA, is planning crewed missions for early next year. Mr Bezos has also said Blue Origin plans to send its first crew to space in 2019.

Virgin Galactic, which is charging $250,000 for a 90-minute flight, has said more than 600 people have bought tickets or put down deposits for an eventual voyage.