Around 1,100 residents of a Derbyshire town have been allowed to return home almost a week after they were evacuated when a nearby dam threatened to collapse.

Parts of Whaley Bridge were evacuated on Thursday last week after heavy rain damaged the dam at Toddbrook reservoir, which sits high above the town.

The deputy chief constable of Derbyshire police, Rachel Swann, said the decision had been taken because the immediate danger posed to Whaley Bridge and the areas downstream in the Goyt valley had now passed.

She said: “The hard work and dedication to achieve this has been quite simply incredible and means that I am now able to lift the evacuation order placed on Whaley Bridge and the surrounding area.

“At the forefront of our thoughts are the communities affected by this incident who have been steadfast in the face of the peril that lay behind that dam wall. The danger posed by the millions of tonnes of water, which would have destroyed homes and livelihoods, could not be underestimated.”

A bookshop re-opens. Photograph: Christopher Thomond/The Guardian

Though heavy rain is forecast for the next few days, Swann said experts from the Environment Agency (EA) were confident that the reservoir would cope. She stressed that the dam was not yet fixed but said a 24-hour pumping operation had reduced water levels to below the damaged section.

“Over the coming days and weeks further work will be completed to ascertain the damage caused to the dam wall and what actions are required for the future. We must not forget that the dam is broken,” she said.

“The Environment Agency has confirmed that the measures remaining in place at the dam will be able to manage the levels of rain forecasted, modelling against a number of scenarios. With this, and confirmation of the effectiveness of the work to repair the damage done and reduce the water coming into the reservoir, I am able to confirm it is safe for people to go back to their homes.”

Bill Derbyshire, from the EA, said: “The Toddbrook dam requires significant engineering works to bring it to a condition where its long-term safety can be assured. The Environment Agency expect the Canal and River Trust to do the necessary investigations and engineering work to make the dam safe and protect the community.”

After seven nights away from home, residents will be allowed to return on Wednesday, with the help of police or partner agencies if necessary. The vast majority of people had sought sanctuary with friends or family living on higher ground.

Derbyshire police said there would be a visible police presence in and around the area for the next seven days to help the community and address any concerns. They thanked residents for their patience with the emergency operation.

Inspection work continues on the dam. Photograph: Christopher Thomond/The Guardian

“The resolve, community spirit, kindness and generosity to their fellow residents, businesses, friends and family shown in the face of such danger has been extraordinary,” said Swann. “That same kindness was given to the hundreds of multi-agency workers at the dam, whose sole focus has been to ensure the resolution to this unprecedented crisis.”

The train line between Sheffield and Manchester Piccadilly had reopened but trains were still not stopping at Whaley Bridge, following the suspension of the line between Hazel Grove and Buxton.

Some roads remained closed, including the southern entrance to Whaley Bridge on the A5004 Buxton Road, just north of the junction of Macclesfield Road and Chapel Road.

A multi-agency hub will open later on Wednesday at Whaley Bridge primary school for residents and businesses. It will stay open for the next seven days, staffed by representatives from High Peak borough council, Derbyshire police, Electricity North West, Cadent Gas, United Utilities, the EA, social care and mental health services.