A tiny scrap of metal that killed a woman in Scotland more than 200 years ago has helped shed new light on the development of ballistics.

It has long been held that the first use of the forensic science anywhere in the world took place during a murder investigation in London in 1835.

Researchers have uncovered evidence that comparative firearms analysis was used in Scotland more than 30 years earlier, after a woman in Aberdeen was shot dead by her estranged husband.

The killing took place in 1804 after Jean McKenzie and John Fordyce became embroiled in a violent custody battle over their daughter.

Jean raised a mob of supporters, forcibly removed the girl from Fordyce, and then led the mob in an attack on his house.

The blacksmith fired a shotgun into the crowd to scare them off but hit his wife in the chest.

A single lead shot pierced her heart and killed her instantly.

Charged with murder, Fordyce denied he had fired the fatal shot but two doctors gathered ballistics evidence which helped convict him.

Forgotten for more than two centuries, the case was discovered by researchers cataloguing old legal archives at the National Records of Scotland in Edinburgh.

The files revealed physicians George French and James Moir extracted the lead shot from Jean McKenzie's heart and matched it to unused pellets belonging to her husband.

Resembling a flattened fragment of metal, the original lead shot and the unused ammunition have been stored for 200 years alongside the old legal documents.

Veronica Schreuder, of the National Records of Scotland, said: "John Fordyce said that he was not guilty of murdering his wife. He didn't know that the shot had hit her heart.

"They wanted to give him a fair and proper trial so the two doctors went back to John's house and they discovered that there was unused shot there.

"They compared them and decided there was enough evidence that the shot fired from his gun belonged to the others from his home.

"It's a very early, if not the earliest, example in the world of this being used to prove either a murder or culpable homicide."

Until now, the first use of ballistics has been credited to London's first professional police force.

In 1835, Henry Goddard of the Bow Street Runners noticed an unusual defect in a bullet taken from a murder victim. He matched it to a mould used to make bullets in the suspect's house.

Forensic scientist Jim Govan from Strathclyde University agreed the Aberdeen case involved a primitive but pioneering use of ballistics.

"I don't know what techniques they would have used for the comparison, whether the pellets removed from the deceased would have related only to the pellets from the house, but it does sound like ballistics," said Mr Govan.

"In that era doctors were used to giving medical forensic evidence in court. It would be nice if it all started in Scotland."

Had he found been guilty of murder, Fordyce would have ended his life at the end of the rope.

Instead, the jury decided he had not intended to kill his wife and convicted him of the lesser charge of culpable homicide.

The first killer in the world brought to justice with the help of ballistics was sentenced to six months' imprisonment and banished from Scotland for 14 years.