For the would-be spaceship named the Dream Chaser, everything on the first flight of a prototype went perfectly — until the craft touched down, toppled on its side, skidded off the runway and wound up in the sand of the Mojave Desert.

The unmanned test flight, conducted in hushed conditions Saturday at Edwards Air Force Base in Southern California, came to an inelegant end after the left landing gear failed to deploy properly.

But the creator of the space plane, Sierra Nevada Corp., which is hoping to win a NASA contract to carry astronauts to the international space station, found much to celebrate despite the rough landing. The vehicle, dropped by a helicopter at 12,500 feet (3,800 meters), flew autonomously in a steep dive, pulled up perfectly, and glided to the center line of the runway, the whole flight precisely by the book until the very end, said Mark Sirangelo, head of Sierra Nevada's space unit, in a teleconference Tuesday.