It was a devastating loss.

Mark Sirangelo and his team at the Sierra Nevada Corp. had been working for years to develop a new space craft to fly astronauts to the International Space Station. But it was ultimately rejected by NASA, which instead awarded multi-billion dollar contracts to two of Sierra Nevada's competitors, Boeing and SpaceX.

Sierra Nevada protested the decision, but lost that, too. And so it seemed as if the program was done. All that time and effort developing the Dream Chaser, a sort of miniature space shuttle, for nothing. Suddenly, the state-of-the-art space craft was like a taxi driving around without a customer.

It was, Sirangelo said at the time, "like a death in the family."

But the company refused to give up.

Sirangelo and his fellow executives decided the company would enter the spacecraft into the next major NASA procurement competition, this time to fly cargo to the station. It wouldn't be easy. The Dream Chaser was a space plane designed for people, not supplies. And there wasn't a lot of time to create another version of the vehicle. While stung by the previous loss, which was hard not to take personally, they were also motivated, channeling their anger into the redesigned cargo version.

The employees at the Colorado-based division of the Nevada company "put their emotions aside and said, 'Let's look at all these things we've been told and make sure we address every one of them," Sirangelo, the corporate director of Sierra Nevada's Space Systems division, said in a call with reporters Friday.

In the end, the failure made them take a hard look "at our weaknesses and forced us to become very introspective," said Steve Lindsey, the company's senior director of programs.

They looked again at their baby and started to see it fro NASA's point of view. Maybe there were some flaws and room for improvement.

"Ultimately, it made us stronger," Lindesy said.

And victorious.

On Thursday, NASA announced that Sierra Nevada joined SpaceX and Orbital ATK in winning the cargo contract, potentially worth billions. The victory validated the company's efforts and breathed life back into the Dream Chaser, resurrecting one of the more creative commercial spacecrafts designed to service the space station.

"It wasn't necessarily the end of the world if we didn't win," Sirangelo said. But he compared it to getting an "anchor tenant at a shopping mall" that will help propel the program forward.

"NASA is the world's best evaluator of these kinds of systems," he said. In awarding the company at least six flights to the station, the agency's leaders "validated our approach, validated our technical ability and validated our company. And that makes the process of going forward a lot easier."

The reusable, autonomous space plane now will come in two versions--capable of carrying astronauts or not--and can land on a runway, like a commercial airplane. That gives it an enormous advantage over NASA's other options, which can't land on wheels, Sirangelo said. The space plane can land at the old space shuttle landing facility Kennedy Space Center, where NASA scientists can be waiting to unload the cargo, almost immediately.

The space station is an orbiting laboratory, designed to perform critical experiments, and being able to get the results into the hands of the researchers as quickly as possible is, Sirangelo said, "a great capability."

When it loss the crew contract, the company had to lay off dozens of employees. But now it is ready to hire "significant" numbers of people once it gets a better sense of the timing of the program from NASA. First flights are expected in 2019 and would run through 2024. In all, NASA said it could spend up to $14 billion on the entire program but expects that number to be less.

Sierra Nevada thinks that once people see its sporty space plane flying to space and landing on a commercial air strip, it will only be a matter of time when "everyone's going to be asking us: When is the crew version coming?' Lindsey said.

Asked if the company would bid on the next round of contracts to fly astronauts to the space station--the competition it had previously lost--he said: "You can count on that."