WASHINGTON — To the surprise of some aerospace industry oddsmakers, Lockheed Martin bested a team of Northrop Grumman and Boeing to win a $3.9 billion contract to help NASA design and build Orion, a capsule meant to replace the space shuttle as the agency’s primary manned spacecraft. The contract could be worth as much as $8.15 billion through 2019, depending on how many of the reusable Orion spacecraft NASA orders.

NASA made the long-awaited announcement Aug. 31, ending an intense competition that began in 2004 shortly after U.S. President George W. Bush called for a new Crew Exploration Vehicle (CEV) to replace the space shuttle and carry astronauts to the Moon.

“The competition was fierce and the proposals were strong,” said Doug Cooke, NASA’s deputy associate administrator for exploration systems, who led the Orion source-selection team. “We think we are picking the right contractor. We know we are.”

Cooke announced the selection of Lockheed Martin during an afternoon press conference at NASA headquarters here. NASA Administrator Mike Griffin, who had telephoned the chief executives of Lockheed Martin and Northrop Grumman earlier that day to break the news, watched the announcement from the audience.

Joanne Maguire, executive vice president of Lockheed Martin Space Systems Co. in Denver, said company employees were “humbled and excited” by the award. “Work already is under way and we are fully focused on the vital tasks that lie ahead to meet NASA’s requirements for the program,” she said .

For Los Angeles-based Northrop Grumman, NASA’s decision brought disappointment but not despair.

“Clearly, Northrop Grumman is disappointed by today’s announcement,” company spokesman Randy Belote said in an Aug. 31 telephone interview. “Orion is, however, merely the first of many significant space systems required to enable routine human space exploration beyond low Earth orbit. Northrop Grumman and its teammates are already helping NASA define the requirements for future elements and Northrop Grumman fully expects to play a significant role in the development and production of those systems.”

NASA officials declined to provide much detail about why Lockheed Martin was chosen over Northrop Grumman and Boeing until the agency has a chance to debrief both teams and the 10-day window for filing a formal protest of the award has passed.

Caris “Skip” Hatfield, NASA’s CEV project manager, said the agency considered the usual factors such as technical approach, cost, and performance on other programs. But NASA also had a chance during the prolonged competition to see how the competitors responded to the requirements changes the agency made along the way. Lockheed Martin, Hatfield said, “had the answers to where we wanted to go.”

At the outset of the CEV competition NASA intended to leave a large share of the design decisions to industry and keep two teams in the mix until late 2008 — when a head-to-head flight demonstration would help the agency pick the winner.

Those plans changed, however, when Griffin took the reins at NASA in April 2005 determined to narrow a four-year gap between the space shuttle’s planned 2010 retirement and the introduction of its replacement. Griffin cut two years off the timetable for selecting the CEV prime contractor and decreed that the vehicle would be a six-person ballistic re-entry capsule — he later dubbed it “Apollo on steroids” — effectively ruling out the possibility of an aerodynamic lifting-body design.

Northrop Grumman and Boeing appeared to have an edge at that point , having been focusing on a capsule design all along. Lockheed Martin had been concentrating on a winged vehicle that resembled a smaller, sleeker version of X-33, an experimental reusable rocket on which NASA and Lockheed Martin together spent more than $1 billion before calling it quits.

“When NASA changed the baseline, the industry bets were that [Northrop Grumman and Boeing] had it nailed,” said Jim Cantrell, president of the Hyde Park, Utah-based consulting firm Strategic Space Development. “The advantage became Lockheed’s, ironically, because they were better equipped to re-jigger their configuration in a moment’s notice,” he said.

Lockheed Martin and the Northrop Grumman-Boeing team spent two years responding to an evolving set of requirements for a vehicle NASA wants in service no later than 2014 to ferry astronauts and cargo to the international space station and later transport up to four astronauts to the Moon.

Lockheed Martin’s initial contract runs through Sept. 7, 2013, and covers design, development, construction, testing and evaluation of the first two Orion spacecraft. Production of additional vehicles is covered by a set of still-to-be negotiated options that would run through Sept, 7, 2019, and be worth as much as $3.5 billion, NASA said. An additional $750 million in sustaining engineering work NASA expects to assign Lockheed Martin over the life of the contract brings its total estimated potential value to $8.15 billion through 2019.

Lockheed Martin plans to perform the majority of the Orion vehicle engineering work in Houston near NASA’s Johnson Space Center and complete final assembly of the vehicle at the Kennedy Space Center, Fla. All 10 NASA field centers will provide technical and engineering support to the project.

Lockheed Martin’s Orion teammates include: United Space Alliance of Houston, the Boeing-Lockheed Martin joint venture that operates the space shuttle; Orbital Sciences Corp. of Dulles, Va.; Honeywell Defense and Space Electronics Systems, Minneapolis ; and Hamilton Sundstrand of Windsor Locks, Conn.

The number of vehicles NASA ultimately buys from Lockheed Martin depends on a number of factors, including how many flights the agency can get out of each spacecraft and how many missions it needs to conduct in the decade ahead.

John Karas, Lockheed Martin vice president of human space flight programs, said the contract could cover as many as eight vehicles “assuming we are going to fly a lot to the station and the Moon.”

In parallel to the CEV program, NASA is spending $500 million to subsidize development of two private space launch systems that could reduce or even eliminate the need for Orion to go to the station. Space Exploration Technologies of El Segundo, Calif., and Rocketplane Kistler of Oklahoma City are combining private investment with NASA money under the Commercial Orbital Transportation Services demonstration program to build space station cargo and crew delivery services that would be available starting around the end of the decade. If any U.S. can service the space station safely and more cheaply than Orion, NASA has said it will buy those services commercially and focus Orion on its lunar objectives.

But Lockheed Martin has bigger threats to worry about than a having a potential competitor to Orion for space station logistics services, according to Brett Lambert, an aerospace consultant and managing partner of the Densmore Group here. The company’s biggest challenge, and one NASA faces as well, is keeping the Orion program sold.

“This award just allows Lockheed to live to fight another day ” in the human spaceflight business, Lambert said. “There’s going to have to be a public campaign and political campaign to keep this program alive.”