THERE'S a painting hanging in the National Gallery which one could so easily overlook. In quality, it's by no means a masterpiece, and with a close eye you can still see the scars of vandalism endured over the years. Even the artist, just an attribution at this stage, is not widely known. But this all belies the painting's true value, which in historical terms is actually priceless.

The painting in question, Courtyard at the Rubenshuis, once hung upon the walls of Denham Court and has until now been in the care of the Buckinghamshire County Museum in Aylesbury.

But since last week it has become something of a star attraction at The National Gallery's new Discoveries exhibition.

New research has revealed that the painting, dated to between 1645 and 1675, is the earliest known depiction of the house once owned by artist Peter Paul Rubens in Antwerp - and the only true record of how he decorated it.

Such is the importance of the painting that the Bucks County Museum is currently in talks with the Rubenshuis, now one of Antwerp's most prominent art galleries, about the possibility of a long-term loan.

But more than that, there's now a creeping realisation that conservation work carried out on the Rubenshuis to restore the building to its original glory, was based on later and less-detailed sketches. Future restoration work will no doubt depend on this painting for a more accurate account of how the house once looked.

"It's very valuable from an historical point of view," says researcher Anne Cowe.

Standing next to the painting inside the National Gallery, she points to one area and adds: "One of the most important aspects is this frieze above the doorway.

"On the actual Rubenshuis, it was thought to have been designed and painted by Rubens himself, or at least one of his pupils on his instructions."

When the house fell into disrepair early last century, there were attempts to restore the Rubenshuis by looking at two black and white engravings from the 1660s. But these do not show any of the decoration or colouring evident in Courtyard at the Rubenshuis, which has been attributed to minor Flemish painter Anton Gunther Gheringh.

These new revelations about the painting came to light thanks to the National Inventory Research Programme (NIRP), a groundbreaking research project designed to discover more about Britain's public art collections.

The NIRP project presents a successful collaboration between the University of Glasgow, Birkbeck College (University of London) and the National Gallery for the last three years.

Researchers were sent to more than 200 regional museums to inspect European paintings from 1200 to 1900. Along the way, they discovered a wealth of stories, suggested attributions and enhanced understanding of a wide range of paintings, eight of which have now been selected to hang in the Discoveries exhibition.

Before the project came about, little was known about Courtyard at the Rubenshuis, which had been rescued by the Buckinghamshire County Museum after years of abuse at its former home, Denham Court.

Once a lavish 17th Century stately home, Denham Court was at one time owned by Thomas Hamlet, a keen art collector. Among his purchases was an important work by Titian, the Bacchus and Adriadne, which can now be seen in the National Gallery.

However, by the 1930s the house had been neglected and fallen into severe disrepair. It was eventually taken over by the county council.

Twenty years later, Denham Court was turned into a young offenders' home.

Along with nine other paintings, Courtyard at the Rubenshuis, which was set into a panel and placed above a fireplace, suffered severe gashes, several pock marks and scrawls of graffiti, including expletives, at the hands of the inmates.

Anne Crowe adds: "An anecdotal history of someone at the centre said the Rubenshuis was even at one time used as a dartboard. It suffered very badly."

When the council sold the building in the 1980s, the artwork, including the damaged paintings, was taken into the care of the Bucks County Museum and restored extensively.

Nancy Ireson, curator of the exhibition, tells me: "The painting had a slash right across it.

"You can still see areas of retouching on the floor and sky, but fortunately for us, it's the areas around the house and the decoration above the doorway that is most interesting and remained untouched by the damage."

For the Bucks County Museum, the research has now provided not only new insights into the painting, but also its historical context.

Sarah Gray, curator of the Bucks County Museum, says: "What's really interesting about this painting is what it shows, rather than the damage it sustained. It could have such wide implications for the Rubenshuis.

"On top of that, this exhibition provides a fantastic opportunity to bring this work of art to the public. We currently have nearly 5,000 works of art in total, and we can never put everything out that we own. There simply isn't the room."

Alexandra MacCulloch, keeper of art at Bucks County Museum, adds: "I think one of the most surprising things about the research is that when I look at it, it's not the work of a great artist, so why should it become so significant? But now I know it's true historical value, its become so much more."

Discoveries runs at The National Gallery, Trafalgar Square, London, until Saturday, February 10, 2008.
Details: www.nationalgallery.org.uk.

The NIRP project has also provided a database of 8,000 works of art, which the public can now access online at http://vads.ahds.ac.uk/collections/nirp.html