A £31.4 million flood protection scheme in the Scottish Borders has been officially opened.

The completion of the Selkirk project was marked by the burial of a time capsule by Environment Secretary Roseanna Cunningham, Scottish Borders Council leader councillor David Parker and local schoolchildren.

The Scottish Government provided 80% of the funding for the scheme, which will protect about 600 homes and businesses from severe weather.

Areas including Riverside, Bannerfield and Philiphaugh were badly hit by flooding in 2003 and 2004.

The project includes a water management system at St Mary's Loch which can store the equivalent of 620 Olympic swimming pools' worth of water and which was put to use during Storm Desmond in December 2015.

Two kilometres of flood defences have been created as well as a 90-metre footbridge designed to remain open even during flooding.

Construction of the scheme is estimated to have generated business worth £6 million for the local economy, with more than 150 people employed.

Ms Cunningham said: "Flooding can have devastating consequences for individuals, businesses and communities, and that is why we are working with partners and investing in schemes to protect against flooding.

"The opening of this new scheme is good news for Selkirk and will provide lasting protection for around 600 properties against the sort of flooding that has affected this area.

"We are committed to reducing flood risk across Scotland. We will continue to make available £42 million a year to fund important new projects to protect communities most at risk from flooding."

Mr Parker added: "Around 600 homes and businesses now have protection from major flood events thanks to the Selkirk flood protection scheme, the largest project of its kind delivered by Scottish Borders Council.

"We must thank the Scottish Government for their support of this project, which we believe will encourage business growth and employment, as well as provide protection to people's homes from major flood events.

"The council will continue to take forward the Hawick flood protection scheme with the aim of providing similar protection to its residents and businesses."