The skeleton of a man discovered in a school playground could be that of a 600-year-old pirate, archaeologists have said.

The remains were found in Edinburgh's Victoria Primary School last year while survey work was being undertaken to build an extension.

The school, the city's oldest working primary, is located near Newhaven harbour where a gibbet once stood on the dockyards 600 years ago.

Workers there expected to find remains of the original harbour and shipbuilding but instead uncovered human bones.

Experts at AOC Archaeology carbon dated the bones to the 16th or 17th centuries and, working with forensic artist Hayley Fisher, created a facial reconstruction of the man, thought to have been in his fifties.

A gibbet was commonly used to execute witches and pirates and it is believed the man could have been murdered in the device for criminal behaviour or piracy and discarded in nearby wasteland.

Due to the condition of the bones and location of his burial close to the sea and gibbet rather than any of three nearby graveyards, it is believed the man was likely killed before being displayed in plain sight of ships to deter fellow pirates. An unceremonious burial in a shallow, unmarked grave suggests he had no relatives or friends in the area.

Councillor Richard Lewis, culture convener for the City of Edinburgh Council, said: "Edinburgh has an undeniably intriguing past and some of our archaeological discoveries have been in the strangest of places.

"Thanks to carbon dating techniques, archaeologists now know that the skeleton was likely to have been a murder victim - and quite possibly a pirate.

"It's fantastic that through the council's archaeology and museums service, we are able to investigate such discoveries and add to our understanding of Newhaven's heritage."

Head teacher Laura Thompson said: "The pupils think it's fantastic that a skeleton was found deep underneath their playground.

"The archaeologists will hold a special lesson with some of the children about how they have used science to analyse the remains and it will be a good learning opportunity for them."