WWII codebreaking centre Bletchley Park is to receive a £330,000 grant from English Heritage.
The funds from the conservation body will pay for urgent repairs to the roof of the Grade II-listed mansion and prevent it falling into further disrepair.
Bletchley Park is famous for the role it played in decrypting messages enciphered by the Nazi Enigma machine, and also for housing the world's first codebreaking supercomputer, Colossus, which cracked the codes used to encipher messages between Hitler's high command.
The roof repairs are expected to be completed by the end of March 2009 and will stop leaking water from destroying the mansion's decorative plasterwork, painted ceilings, timber panelling and fine fireplaces.
Simon Greenish, director of the Bletchley Park Trust, said in a statement that the donation would "ensure that the structure and fabric of the iconic Bletchley Park mansion are preserved".
"It marks the start of a regeneration initiative on behalf of the Bletchley Park Trust to transform Bletchley Park into a world-class heritage and education centre," he said, adding: "This is sacred ground. If this isn't worth preserving, what is?"
Bletchley Park was in a state of neglect when the trust took it over in 1992. Since then, the trust has raised £5m to develop and restore parts of the site.
Earlier this year, a stark warning letter from almost 100 academics was published in a national newspaper calling for action to save the mansion from the "ravages of age".