A FAILED attempt at a selfie by a primary school boy may have captured the best-ever photograph of a ghost.

The child from St Boswells was visiting Jedburgh Castle Jail last weekend with his dad.

And after venturing into the perfectly-preserved reform prison's cell blocks they took several photographs of the eerie surroundings.

But the boy's attempted selfie, which was about to be deleted this week, has captured something strange.

The dad told us: "I was clearing out photos on my phone when I took a second look at my son's attempted selfie.

"He'd missed himself but he's taken a photo of something in the cell - it was chilling.

"I can't describe this as anything other than a floating apparition looking at us."

Jedburgh Castle Jail was built in the 1820s on the site of the town's medieval castle.

Several executions took place within its walls before it was closed in 1868 after being regarded as too primitive and cruel by governors

It re-opened almost a century later in 1964 as a visitor attraction.

And ever since ghost hunters from around the world have carried out investigations, with paranormal experts from the popular TV show Most Haunted claiming the cell blocks were one of the 'most frightening' venues they visited.

Several visitors over the past few decades claim to have seen ghostly figures and unexplained lights.

But nobody has ever captured one on camera - until now.

The photograph shows a floating figure in the doorway of a cell.

The most famous ghost said to haunt the Howard reform prison is that of prisoner Edwin McArthur who was executed at the jail 1855.

He is said to lurk around the cells and enjoy scaring visitors.