A 365-year-old mystery about what happened to the bodies of Scottish soldiers captured by Cromwell's forces after a bloody battle has been solved, archaeologists have said.

Skeletons discovered in a mass grave close to Durham Cathedral in 2013 have been extensively tested and researchers are certain the bones are those of prisoners from the 1650 Battle of Dunbar, some 111 miles north.

Now public discussions will start about what will happen to the remains, found naked and buried without ceremony, with one possibility that they will be returned to Scotland for burial.

After Oliver Cromwell's unexpected victory over Scottish forces who supported Charles II, around 6,000 were captured, with 1,000 of the sickest being freed.

Around a further 1,000 of the hungry, defeated soldiers died on the gruelling march south, many of the them suffering from dysentery, then known as "the flux". Some escaped and some were shot for refusing to walk further.

Around 3,000 Scots were imprisoned in Durham Castle and Cathedral, which were abandoned at the time and would have provided bleak shelter.

Experts have estimated around 50 of them died every day, with 1,700 thought to be buried at locations around what is now a UNESCO World Heritage site.

In November 2013, during work on a new cafe, the remains of between 17 and 28 people were found in a mass grave.

Tests by Durham University's archaeology department have pinpointed the origins of these bare remains and given them back their place in history.

Analysis showed they were male, mainly aged 13-25, and isotope tests showed they were likely to be from Scotland, though three were believed to be Northern European mercenaries.

Study of the teeth showed some smoked clay pipes, which were common in Scotland after 1620.

Examination of the bones showed no evidence of healed wounds, indicating these men were not battled-hardened veterans, nor died from their injuries, and the fact they were naked and buried in a hurry led to the belief they were suffering from disease.

Senior archaeologist Richard Annis said: "This is an extremely significant find, particularly because it sheds new light on a 365-year-old mystery of what happened to the bodies of the soldiers who died.

"The burial was a military operation: the dead bodies were tipped into two pits, possibly over a period of days."

The burial site, at the far end of the castle grounds, meant they were "out of sight, out of mind", he said.

But that will not remain so, as prayers will be said at the cathedral on Thursday, the anniversary of the Battle of Dunbar.

And discussions will be held with interested parties, including the Church of Scotland, about what should happen to the remains, which will be reburied, possibly at a local churchyard, or potentially in Scotland.

Canon Rosalind Brown, of Durham Cathedral, said: "We are particularly mindful of descendants of the Scottish soldiers and hope and pray that this new information can bring solace."

Some survivors of the Durham imprisonment were known to have been sent to Ireland, while others went to Barbados and New England, with descendants known to be still living in Maine and Massachusetts.

Skeltons flesh out remarkable details of lives of Scottish soldiers

Analysis of the remains of the Scottish soldiers discovered in a mass grave close to Durham Cathedral has revealed remarkable details of their lives, archaeologists have said.

Ridges on the teeth, known as enamel hypoplasia, showed the dead men suffered from malnutrition or similar medical trauma during childhood, said Dr Pam Graves, a senior lecturer in archaeology at Durham University.

"We know these people had relatively harsh childhoods," she said.

Analysis of their sinuses showed some of them grew up in polluted atmospheres, possibly a smoky cottage or villages and towns with poor air.

A lack of wounds on the bones indicated the soldiers were not battle-hardened, she said. "These were not veterans, these were ordinary lads from farms, workshops, towns and fishing villages."

Markings on the teeth showed some smoked clay pipes while others had obvious notches, indicating they had damaged their teeth through work, perhaps as weavers or mending nets.

The men kept prisoner in Durham would have been ordinary, lower rank soldiers as the officers were held in Newcastle on their way south.

Conditions on the march after battle were grim, Dr Graves said.

A contemporary record by an English commander showed many died on the way south, others escaped and some of those who refused to walk further through hunger were shot.

Dr Graves said that during a stop in Morpeth, Northumberland, the captives were held in a walled garden.

"While they were corralled there they ate cabbages right out of the soil they were so hungry," she said. "Of course, that creates dysentery and exacerbates the other conditions they were suffering."

She warned against judging the treatment of the Scottish soldiers with modern eyes, as standards were different then, but she said: "There is no doubt there was a great deal of suffering."