A manager at Penrhyn Castle, near Bangor, North Wales, deciphered the inscription – Italian rather than Latin – as “to be loved while loving”.

Historians believe the words were scratched on the glass by lovelorn teenager Lady Alice Douglas-Pennant.

We knew the room had been Lady Alice’s bedroom. So it was fair to assume the writing was hers and we began to dig

House steward Clare Turgoose

In a story that bears striking similarities to the novel Lady Chatterley’s Lover, her father, industrialist and Tory MP Lord Penrhyn, banished her to a tower for falling in love with a gardener. During her time in solitary confinement around 1880, she is said to have scratched out the message as a memento of her love.

The National Trust – which runs the 19th century neo-Norman castle – is indebted to Italian-born education manager Resi Tomat for solving the riddle.

House steward Clare Turgoose said: “We knew the room had been Lady Alice’s bedroom. So it was fair to assume the writing was hers and we began to dig.

“The story goes that Lord Penrhyn forced her to stay in the nursery to keep her away from her love.”