Researchers at Durham University concluded that the identification of the remains as the Dunbar prisoners was "the only plausible explanation" when scientific data was analysed alongside historical information.
The Battle of Dunbar was one of the most brutal, bloody and short battles of the 17th Century civil wars. In less than an hour the English Parliamentarian army, under the command of Oliver Cromwell, defeated the Scottish Covenanting army who supported the claims of Charles II to the Scottish throne.
Although the exact figures are not known, it is thought that around 1,700 Scottish soldiers died of malnutrition, disease and cold after being marched over 100 miles from the South East of Scotland to Durham, in North East England, where they were imprisoned in Durham Cathedral and Castle, by then disused for several years.
Surviving prisoners were transported to different parts of the world including Virginia and New England, USA, where they worked as indentured servants. They were able to gain their freedom if they saved enough to redeem their sale price or if they worked the full term of their indenture and a number went on to become successful farmers in Maine.
What happened to the bodies of those who died has been a mystery for almost 400 years, but the Durham University researchers believe they have begun to solve the puzzle.
In November 2013, during construction of a new café for the University's Palace Green Library, on the City's UNESCO World Heritage Site, human remains were uncovered by Durham University archaeologists who were present throughout the building work.
The jumbled skeletons of at least 17 and up to 28 individuals were subsequently excavated from two burial pits (a 29th individual was not exhumed). Since then the researchers have been carrying out a wide range of tests to try and establish their identities.
Experts initially considered that most of the evidence was consistent with the bodies being those of the Scottish soldiers but could not draw a firm conclusion from research conducted in 2014 because initial radiocarbon dating analysis indicated a slightly earlier date of death than the Dunbar battle.
However, further radiocarbon dating analysis of four additional samples, which were carefully selected to ensure a more precise result, in combination with the fact that some of the prisoners had smoked clay pipes - known to be in common use in Scotland after 1620 - has concluded that the date of death was between 1625 and 1660.
When these dates are combined with the nature of the graves; the results of earlier scientific and observational tests that established the adult skeletons were all male; the fact that the skeletons were predominantly aged between 13-25 years old; and as isotope analysis showed the skeletons were of likely Scottish origin, all this points to their identification as the prisoners from the Dunbar battle.
A team of experts from Archaeological Services Durham University - the University's commercial archaeology consultancy unit - and academics from the departments of Archaeology and Earth Sciences, worked together to excavate and analyse the skeletons.
The excavation and research were funded by Durham University.
Dr Andrew Millard, senior lecturer with Durham University's Department of Archaeology, said: "Proving a theory in archaeology involves assembling lots of different types of evidence and piecing the jigsaw together so that we can make an informed assessment.
"When we had the results of the first radiocarbon dating tests we had a very broad date range and were not in a position to draw a definitive conclusion as to the identity of the skeletons, which is why we carried out further tests.
"Taking into account the range of detailed scientific evidence we have now, alongside historical evidence from the time, the identification of the bodies as the Scottish soldiers from the Battle of Dunbar is the only plausible explanation."
The battle left anywhere between 300 and 5,000 dead. Modern calculations suggest that an estimated 6,000 Scottish soldiers were taken prisoner with about 1,000 of those who were sick and wounded then released to go home.
About 1,000 of the men are believed to have died en route to Durham from a combination of hunger, exhaustion and gastric problems - probably dysentery. Others were executed, while some escaped.
Around 3,000 Scottish soldiers in total were then imprisoned in Durham Cathedral and Castle, at a time when the Cathedral was empty and abandoned, its Dean and Chapter having been evicted and worship suppressed by order of Oliver Cromwell, as was the case with all English Cathedrals at that time.
An estimated 1,700 prisoners from the battle died and were buried in Durham and experts say that there are potentially many more burials nearby.
Richard Annis, senior archaeologist, Archaeological Services Durham University, 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.
"Their burial was a military operation: the dead bodies were tipped into two pits, possibly over a period of days. They were at the far end of what would have been the Durham Castle grounds, as far as possible from the Castle itself - they were out of sight, out of mind.
"It is quite possible that there are more mass graves under what are now University buildings that would have been open ground in the early to mid-17th Century."
The Durham University team, with Durham Cathedral, will be working with partners and interested parties to determine what will happen to the remains of the Scottish soldiers, and an appropriate commemoration.
These discussions are likely to include the Church of Scotland, since the prisoners would have been predominantly Scottish Presbyterians.
Remembrance prayers will be said at Durham Cathedral tomorrow (Thursday, September 3), the anniversary of the Battle of Dunbar.
Canon Rosalind Brown, of Durham Cathedral, said: "There is a plaque at Durham Cathedral in commemoration of the Scottish soldiers, which was dedicated in November 2011 on St Andrew's Day. The discovery of the bodies and the conclusion that they are some of the Scottish soldiers is of great significance.
"The Cathedral will work closely with all interested parties to determine the most appropriate course of action for the burial of the soldiers in a manner appropriate to their Christian tradition. We are particularly mindful of descendants of the Scottish soldiers and hope and pray that this new information can bring solace."
If considered appropriate, there could be further research work to determine further biographical details and discover more about the lives the soldiers led prior to their involvement in the Battle of Dunbar, although this will require additional funding. The bodies will eventually need to be reburied according to the terms of the exhumation licence issued by the Ministry of Justice.
Explore further: Scottishness is a more inclusive national identity than Englishness for many ethnic groups in Britain