An unfinished portrait of Mary, Queen of Scots has been found hidden beneath another 16th century painting.

The ghostly image of the doomed monarch was found using X-ray photography as part of a special research project at the National Galleries Scotland.

The picture was beneath a painting of Sir John Maitland, an influential noble who served as Lord Chancellor of Scotland.

It was painted by Dutch artist Adrian Vanson, who worked in Scotland towards the end of the 16th century.

The portrait is dated 1589, two years after the queen's death, and it is thought the artist may have abandoned his portrait of Mary after she was executed.

It is part of the National Trust's collection and is usually hung at a stately home near London.

An X-ray revealed the presence of a pigment depicting a woman's face and the outline of her dress and hat beneath the upper layers of paint.

Conservator Caroline Rae said the image of the woman found beneath Maitland was distinctly similar to other depictions of her, with matching clothing.

Ms Rae said: "The discovery of this hidden portrait of Mary, Queen of Scots is an exciting revelation, not only as it adds to our knowledge of 16th century Marian portraiture and patterns of commission at the time, but as it aids in illuminating our understanding of Adrian Vanson, a Netherlandish émigré artist who came to Jacobean Scotland to seek a new life and quickly ascended to the status of Crown painter."

Despite the fascination with Mary, Queen of Scots, there are few authentic portraits of her during her time in Scotland.

Christopher Baker, director of the Scottish National Portrait Gallery, said: "This fascinating discovery has been made thanks to an innovative collaboration undertaken by the National Galleries of Scotland, the Courtauld Institute of Art and the National Trust.

"The shadowy presence of the queen beneath a painting of Scotland's Lord Chancellor could not have been detected without Dr Rae's technical expertise.

"The analysis of this intriguing picture forms a key part of a broader project, which we hope will raise awareness of such important research for many visitors to the Scottish National Portrait Gallery."

The results of the research project will go on display at the Scottish National Portrait Gallery this week.