The US space agency plans to use the Orion crew exploration vehicle to replace the space shuttle fleet, take astronauts to the moon and perhaps to Mars.
The spaceship is reusable and like Apollo and earlier spacecraft, it is perched atop the rocket.
Nasa estimated the total cost of the project up to the year 2019 as $7.5bn.
The contract was a significant victory for Lockheed and a major defeat for its only rival, a joint bid from Boeing and Northrop Grumman.
An expert in building unmanned spacecraft and rockets, Lockheed has only a small amount of experience with human spaceflight.
In direct contrast, Boeing, Northrop Grumman and their subsidiaries built both the space shuttle fleet and the Apollo craft the 1960s and 70s.
Asked why Lockheed Martin was chosen over the competing team, Doug Cooke, a deputy associate administrator at Nasa, said: “We feel we have an achievable design. This is a design that is based on known capabilities. We know that this can be built so there are some differences there, perhaps.”
Last year, Nasa chief Michael Griffin described Orion as “Apollo on steroids”.
The last time Nasa awarded a manned spaceship contract to Lockheed Martin was in 1996 for a spaceplane that was supposed to replace the space shuttle.
Nasa spent $912m on the project and the craft, called X-33, was never built due to technical problems.
Paul Nisbet, an aerospace industry analyst, said: “Nasa decided to do something different and go with a company that has not been in manned space before, sort of spreading the wealth and making sure they’ve got two contractors that know the manned space business.”
If all goes according to plan, the first test flight of Orion will be September 2014 and astronauts could return to the moon by late 2019 or 2020.
John Karas, Lockheed Martin vice president, said his company, if asked, could make the first flight in 2013.