A skeleton discovered under a primary school playground could be that of a 16th-century pirate, archaeologists have said. The remains of a man were uncovered by council workers during survey work for an extension at Victoria primary school in Edinburgh last year.

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

The school, the city’s oldest working primary, is located near Newhaven harbour where a gibbet stood in the dockyards 600 years ago. It is believed that the man may have been executed for piracy or another crime before being buried in a shallow, unmarked grave. Archaeologists said the condition of the bones and location of the burial close to the sea and gibbet suggested that the man was killed before being displayed to deter other pirates.

Councillor Richard Lewis, culture convener for the council, said: “Edinburgh has an undeniably intriguing past and some of our archaeological discoveries have been in the strangest of places. 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.”

The school’s headteacher, 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.”