The area where the discovery was made has now been fenced off, but the school still remains open.

Mary Bainbridge, the school’s acting headteacher, sent out a letter to all parents and pupils earlier this week to inform them of the discovery

She said that “due to the nature of the discovery, the police were initially called but have now passed the matter to the council’s archaeologist.”

Ms Bainbridge said: “This archaeological work did not affect the school opening as usual and the construction of the new classroom building will continue once the council’s archaeologist gives the go-ahead.”

She added: “The school is very excited about the educational opportunities that the archaeological work on site may present.

“I have already been in discussion with the council’s archaeologist about the different ways the pupils will be able to engage and the experiences that can be offered.”

Morrison Construction workers also discovered ancient pottery when they came across the human remains last Tuesday. The builders are still working at the school, assisting the council’s archaeologist with further digging and investigative work.

John Lawson, the council’s archaeologist, said: “The skeleton was uncovered as part of a carefully planned excavation.

“This seems to be the site of an unknown, unmarked grave dating to the 17th century.

“It is thought the burial, outside the original Edinburgh town borders in Leith, may be a plague victim but further analysis needs to be undertaken.”

Councillor Richard Lewis, Edinburgh Council’s culture chief, said: “Edinburgh has such a rich history and the skeleton at St Mary’s is yet another astonishing archaeological find. The Council will work with Morrison Construction to further investigate.”

Earlier this year the skeleton of a 16th century pirate was unearthed under Victoria Primary school in Newhaven by council workers carrying out a survey.

The bones were found near the site of the medieval harbour where pirates were once hanged from a gibbet and displayed in view of ships as a deterrent to others.