More than 200 police officers turned out to honour 26-year-old James, who was bludgeoned to death with iron bars by three robbers in 1893.

And he was given a headstone at last, paid for by the Police Roll of Honour Trust.

James was born in Fordoun, Kincardineshire, the son of a ploughman and one of eight brothers and sisters.

But he worked, and died, in St Helens on Merseyside, where his colleagues in the Borough Police Force described him as “an affable, good-tempered young fellow, brave as a lion, and at all times to be relied on in the performance of his duty”.

James knew his duty on the night of November 12, 1893, when he and a colleague caught three men breaking into a boiler works.

He confronted the robbers and was savagely beaten. He was given first aid and sent home, but died early the next morning.

His murderers were condemned to hang, although the sentences were later commuted to 15 years’ hard labour.

Judge Mr Justice Day told them: “The policeman’s life had been sacrificed whilst he was discharging his duty.

“The poor fellow was in the prime of his life, being just 26 years old and he treated you with every conceivable consideration.

“He had, however, been hurried into the presence of his Creator without a single moment’s warning, owing to the brutal violence of you, the prisoners.”

The people of St Helens raised £30 – a large sum at the time – to send to James’s mum in Scotland.

But after that, his courage was largely forgotten, and he was buried without a headstone in St Helens Cemetery.

That all changed when retired Merseyside Police officer Brenda Neary, a volunteer at the cemetery, tracked down his grave.

The Police Roll of Honour Trust commissioned a headstone for James, and a piper led a parade to the graveside yesterday for the dedication ceremony.

It was performed by Geraldine Winner, whose late film director husband Michael founded the Police Memorial Trust after the murder of PC Yvonne Fletcher in 1984.

She said at the graveside: “Michael would have been so proud to be here.

“The Trust exists to honour the fallen. PC Gordon has not been forgotten.”