The search giant will lease 1.2 million square feet of office space at Nasa's Ames Research Center in Google's home town of Mountain View, California.
The 40-year lease will include a US$3.2 million annual payment from Google which will be adjusted according to market rates.
Nasa plans to use the money for improvements and maintenance costs at the Ames Research facility.
The space agency also hopes that the deal will boost its presence in the tech world.
"With this new campus we will establish a new era of expanded collaboration with Google that will further enhance our Silicon Valley connections," said Ames director S. Pete Worden.
"This major expansion supports Nasa's mission to lead the nation in space exploration, scientific discovery and aeronautics research."
The pair hope to begin the first phase of the construction process by 2013. A second phase will begin in 2018 and the final construction project will start in 2022. Nasa will be responsible for the construction process.
In addition to the office and laboratory space, the project will see the construction of housing, child care, dining and recreational facilities for both Google and Nasa employees.
Google will be able to exercise three 10-year options when the 40-year lease ends, while Nasa and Google will have joint say over two further 10-year extensions, giving the deal a possible length of 90 years in total.
"This long-term agreement is a key component of Google's strategy for continued growth in Silicon Valley," said David Radcliffe, vice president of real estate and workplace services at Google.
"We believe this collaboration between Google, Nasa and the city of Mountain View is emblematic of the mutually beneficial partnerships that can be created between the public and private sectors."
Google to move in with Nasa
By Shaun Nichols on Jun 6, 2008 7:44AM