Prime Minister Boris Johnson has praised all those involved in the operation to secure Toddbrook Reservoir over the last week.
Mr Johnson, who visited the site last week, has made his comments after residents were allowed to return to their homes.
In a tweet, he said: "So pleased to hear that #WhaleyBridge residents, who have shown such spirit and patience, are being allowed back into their homes. I want to thank the volunteers, emergency services, Armed Forces and all who responded with such professionalism and dedication."
Emergency services, armed forces, partner agencies and volunteers have been working around the clock since last Thursday to shore up the dam after heavy rain caused damage to the dam wall.
Residents who were evacuated from their homes last Thursday have this afternoon been told they can return home.
Defence Secretary Ben Wallace has also praised the armed forces involved in the operation.
He said: "Our Royal Air Force and British Army personnel have worked tirelessly alongside the emergency services to ensure that residents can now return to their homes.
"Our Armed Forces have demonstrated the skills, capability and professionalism needed to react to challenging circumstances.
"Time and time again the UK military shows it is able to support the wider public sector in its time of need.
"Along with residents of Whaley Bridge, I want to thank everyone involved for their hard work that has ensured the safety of the community."