Image copyright Seacams 2 Image caption A sonar image shows the intact and cigar-shaped U87 German submarine lying on the seabed

A German U-boat sunk on Christmas Day 1917 has been pictured for the first time using sonar imaging technology.

U-87 went down off the north Wales coast when it was rammed by an escort vessel hours after sinking a steamship.

The survey of the U-boat is part of a project examining World War One shipwrecks around the Welsh coast.

The technology has also been used to capture a new, more detailed view of a British submarine which sank in Caernarfon Bay, Gwynedd, in March 1918.

The colour image shows the broken hull of HMS H5 which was rammed by a British merchant ship that had thought it was an enemy vessel.

A survey boat carrying the sonar equipment has also generated an image of the German U-87, which went to the seabed with more than 40 crew on board, after it was hit by HMS Buttercup.

Dr Michael James Roberts, from Bangor University's Centre for Applied Marine Sciences, said it was a "moving and thought-provoking experience" when the sonar image appeared on the computer screen for the first time.

"Regardless of who these men were, they were only doing their job," he said.

Image copyright Seacams 2 Image caption Technician Ben Powell views sonar images onboard the survey vessel as the images are captured from a device beneath the boat

His team have come to know the name of the U-87 as it sank or damaged more than 20 British and Allied vessels between May and November 1917.

Its last target was the SS Agberi, a liner which was torpedoed off Bardsey Island while en route to Liverpool. No-one was killed.

U-87 also lies in deep water off Bardsey Island and its location was only confirmed about a year ago.

It is one of more than 100 World War One wrecks in Welsh waters and some are being surveyed for the "Forgotten U-boat war" project looking at associated shipwrecks around the Welsh coast.

The two-year programme began in 2016. It has been backed with £400,000 from the Heritage Lottery Fund and it also involves experts from the Nautical Archaeology Society.

Image copyright Seacams 2 Image caption The view looking down on British submarine, HMS H5, lying beneath the waves at Caernarfon Bay

The Royal Commission on the Ancient and Historical Monuments of Wales is also involved, helping to share survey findings with maritime museums across Wales and including exhibitions at Porthmadog, Nefyn, Swansea and Pembroke Dock, among others.

So far, about a dozen wreck sites have been analysed, including the British submarine, HMS H5, which went down with its 26-man crew on 2 March 1918, off Holy Island in Caernarfon Bay.

The merchant ship, the SS Rutherglen, reported that it had hit a German U-boat but, after the HMS H5 was overdue by four days, it became apparent that it had been struck.

Image copyright Seacams 2 Image caption SS Damao lying on seabed next to four craters which could have been created by depth charges in World War Two

Another vessel off Bardsey is the SS Damao which, at time of loss on 28 April 1918, was travelling from New York to London with a cargo which included 472 tons of lead.

It was torpedoed by another German submarine, the U-91. The sonar imaging project has revealed four craters on the seabed next to the ship's resting place.

One theory is the site was hit by depth charges in World War Two when the wreck was picked up by a passing warship's sonar detectors.

Today, sonar imaging is revealing important results as sediment causes "awful visibility" in the Irish Sea, according Dr Roberts.

He manages the Seacams 2 sonar project which is being used to find out what happens to undersea structures such as shipwrecks over time, as well as the surrounding environment.

The findings will inform the energy generation industry which is looking to harness tidal power by creating devices such as underwater kites .