Federal prosecutors and former astronaut Edgar Mitchell have reached an agreement over a camera Mitchell brought home from his 1971 Apollo 14 moon mission.
Mitchell said the camera was a gift from NASA, and earlier this year he tried to auction it through the British firm Bonhams.
NASA says the camera is U.S. government property and sued Mitchell to get it back after learning in March it was up for sale.
In papers filed Thursday, the U.S. Attorney's Office in Miami stated Mitchell will give up any claim to the 16 mm motion picture camera and agree to return it to NASA. NASA will in turn give it to the National Air and Space Museum in Washington for display within 60 days.
Both sides will pay their own legal expenses. A judge was expected to sign off on the settlement in the coming days.
Mitchell's attorney Armen R. Vartian said his client decided the settlement was the best way to resolve a conflict with NASA.
"I think both sides saw the lawsuit as something that should not continue," he added.
Mitchell is one of 12 humans to have walked on the moon. He later received the Presidential Medal of Freedom.
The camera was one of two that went to the moon's surface on the Apollo 14 mission, which Mitchell piloted.
During the mission, Mitchell and Alan Shepard spent hours collecting nearly 100 pounds of lunar samples.
They also demonstrated that astronauts could walk long distances safely, covering about two miles on one expedition. Shepard's attempt at swatting a golf ball on the moon can be viewed on the internet.
Mitchell later said he attempted to communicate using telepathy with friends on Earth during the mission.
Since his retirement, Mitchell has devoted much of his life to exploring the mind, physics, the possibility of space aliens and ways of linking religion with scientific fact.