MOJAVE DESERT, California (CNN) -- Onlookers held their breath as the manned SpaceShipOne performed unexpected but spectacular acrobatics on its way into space, the first step toward winning the Ansari X Prize on Wednesday.

The spacecraft landed successfully, but hit problems shortly after the rocket ignited during its vertical ascent. It began a series of about 40 barrel rolls that stopped only when the burn ended and the craft reached its top altitude.

It touched down for a smooth landing about 11:35 a.m. ET, completing a successful flight despite the nail-biting moments.

Pilot Mike Melvill had to shut down the engine 11 seconds before it would have cut off automatically.

"Probably, I stepped on something too quickly and caused the roll," said Melvill, who appeared to shrug off the incident. "It's nice to do a roll at the top of the climb."

It was not clear why the craft lost control. As SpaceShipOne turned groundward, however, Melvill appeared to regain the controls and steady the craft.

"The trajectory was good, the roll was off," said Dick Rutan, a test pilot and brother of Burt Rutan, the SpaceShipOne designer. "I was worried. That wasn't the way it was supposed to be."

An unofficial altitude for SpaceShipOne of 358,000 feet, or about 67 miles, was recorded by radar at the site. An altitude of about 62 miles is necessary to win.

If SpaceShipOne's altitude is confirmed, it will also have beaten the X-15's top altitude of 354,200 feet (67 miles) set on August 22, 1963.

This marks the first of two successful flights the team needs to win the $10 million Ansari X Prize.

SpaceShipOne lifted off from a runway in the Mojave Desert in California, at 10:12 a.m. ET Wednesday.

The revolutionary spacecraft is the first privately financed vehicle to send humans into space.

The plane White Knight carried SpaceShipOne, attached beneath it, to about 50,000 feet where the spacecraft detached and rocketed into space.

To win the contest, privately financed spacecraft must launch three people, or their weight equivalent, to space twice within two weeks.

SpaceShipOne carried only the pilot on Wednesday's flight. Rutan said the extra weight onboard was made up of "trinkets" from members of his brother's team.

The second flight is scheduled for October 4.

Burt Rutan of Scaled Composites designed and tested the rocket during a June 21 suborbital flight.

Despite control system malfunctions, the flight was a success and made Melvill, 63, the first person to earn his astronaut wings aboard a private spacecraft.

Melvill told reporters he had "a hell of a view from 62 miles."

"The colors were pretty staggering from up there," he said. "It's an awesome thing to see. You can see the curvature of the Earth."

The aerodynamics of SpaceShipOne were slightly modified and the power of its engine was increased for the most recent flight.

Rutan said the first spaceflight had brought the world closer to realizing his long-held dream of easy access to space.

"Our hope is that this will be a benchmark ... for a lot more people to not only have fun but to reap the benefits that we believe might be there," said Rutan.

SpaceShipOne is competing with more than two dozen other teams for the X Prize founded by space entrepreneur Peter Diamandis. The only one to challenge SpaceShipOne to the finish line, the da Vinci project of Canada, recently canceled its October 2 flight for a lack of crucial components. The team said its balloon-launched spacecraft would still make an attempt.

The Ansari X Prize -- modeled on aviation awards at the beginning of the 20th century -- is designed to spur the private sector into building a space tourism industry.

Market studies suggest there may be a billion dollar demand for such flights to the edge of space and, eventually, into orbit around the Earth. At least one entrepreneur is plunging headfirst into the businesses.

Virgin Atlantic Airways founder Richard Branson announced on Monday that he would invest $25 million in a new space venture, to be called Virgin Galactic. The project will license Scaled Composite's SpaceShipOne technology for commercial suborbital flights starting at about $200,000. He expects it could fly 3,000 people within five years.

"The development will also allow every country in the world to have their own astronauts rather than the privileged few," he said.

Today's flight launched from a remote airstrip in the Mojave Desert. It is the only civilian test flight center and just one of a handful of spaceports.