More than 550 homes in Godmanchester have been protected from flooding following the completion of a £6.8 million defence scheme.

The system of walls and embankments built through the town came close to being tested when floods built up in the wettest winter since records began in 1910.

Cambridgeshire County Council and Huntingdonshire District Council put £350,000 into the project which has taken nearly two years to complete.

The defences will reduce the town’s risk of flooding from once in 20 years to once in 100 years.

Godmanchester did not have any formal flood defences before the walls went up and the town came close to flooding in 1998, with a number of homes in low-lying areas considered to be at significant risk.

Dr Geoff Brighty, area manager for the Environment Agency, which was behind the scheme, said: “Seeing this flood risk management scheme to completion is a great achievement for everybody involved, but particularly for the people of Godmanchester.

“We have had extreme weather across the country in the past two years, reminding us that many communities are vulnerable to flooding.”

Dr Brighty added: “Today, we mark the moment when this historic town’s defences, that will protect people and property, lives and livelihoods for many years to come, were completed.”

The Environment Agency has been working with the Regional Flood and Coastal Committee and the county and district councils since 2009 to provide a defence scheme. Funding has also come from the Department for the Environment, Food and Rural Affairs and the Local Authority Local Levy.

Steve Wheatley, chairman of the Regional Flood and Coastal Committee, said: “Flood events across the country earlier this year have shown again the devastation and misery that flooding brings to people.”

Cllr Ian Bates, a county council representative on the Flood and Coastal Committee, said: “This flood relief scheme will bring great benefit and peace of mind to people living in Godmanchester.”

He said the cost would have been beyond the resources of a single organisation.

Cllr Jason Ablewhite, district council leader, said: “This is an exemplar example of strategic partners working together to make a positive contribution to the lives and businesses of Godmanchester.

“We have been pleased to not only support this scheme but to contribute financially to ensure that this vital defence against flooding has been delivered.”