Painting of George Villiers, first Duke of Buckingham, thought to have been a copy, is identified as original after 400 years

A long-lost portrait of perhaps one of the most famous gay men in history by the Flemish artist Peter Paul Rubens has been found in Glasgow.

The portrait showing George Villiers, the first Duke of Buckingham, thought to have been James VI and I’s lover, had been hanging in a National Trust for Scotland property and was believed to be a copy of the lost original, which had been missing for almost 400 years.

The masterpiece was spotted in the gallery of Pollok House by Dr Bendor Grosvenor from BBC4’s Britain’s Lost Masterpieces, who suspected that it could be the real deal.

The painting is the subject of an episode of the TV programme on Wednesday, which will show how layers of dirt and overpainting obscured Rubens’s trademark techniques.

Facebook Twitter Pinterest The portrait of Villiers after treatment. Photograph: Simon Gillespie

Rubens, a pioneer of the Flemish Baroque tradition, is considered one of the most influential painters in history and his work is worth millions.

Conservation work carried out by the art restorer Simon Gillespie has returned the portrait, which belongs to Glasgow Museums, to its original state.

This allowed for a new assessment of its attribution and the painting was authenticated as a Rubens by Ben van Beneden, the director of the Rubenshuis in Antwerp.

A range of techniques were used in the process including dendrochronology – examining the tree rings of wood to date it – which showed that the panel on which the portrait was painted was likely to have been created in the early 1620s. It was also found to have been prepared in the manner used in Rubens’s studio.

An analysis of the alterations through cleaning and x-ray demonstrated that the painting could not be a copy, but was Rubens’s lost masterpiece.

Beneden concluded that the portrait was a “rare addition to Rubens’s portrait oeuvre, showing how he approached the genre”.

Grosvenor saw the painting while visiting the stately home with his wife and daughter “as regular punters”.

The self-confessed Rubens anorak said: “There was this painting further up by the fireplace and it sounds rather silly to say it, but it was a bit of a eureka moment and I thought: ‘My god, that looks like a Rubens.’ This picture just seemed to shine out.”

He returned the next day with a pair of binoculars and the following day with a ladder. “It wasn’t until we peeled it all back that we could be really sure. It’s one thing for an optimist like me to have a hunch, but quite another to prove it,” Grosvenor said.

The process took two months in total. “Our restorer, Simon, is a wizard at these things. I don’t mind admitting that I get rather emotional when you see the layers being peeled back and you begin to be one of the first people to see it how Rubens intended,” he said.

Facebook Twitter Pinterest The painting before restoration. Photograph: Simon Gillespie

The portrait is a study for a larger painting. “It’s just a sketch, but in the 18th and 19th century, unfinished work wasn’t as appreciated as it is today, so you get a lot of pictures which are finished off by later artists. So this was tidied up by someone and as a result, it began to look very stiff and more like a copy,” he said.

The final painting was destroyed in a fire in 1949, so it is very fortunate to have found this version, Grosvenor said.

Although the Duke of Buckingham’s personal relationship with James VI and I is much debated, the king referred to Buckingham as his husband, and their relationship scandalised the court. In 1628, the duke was assassinated at the age of 35, three years after James died.

It was known that Rubens had painted a portrait of Buckingham in about 1625, but the work had been regarded as lost by art historians for almost 400 years.

Grosvenor said: “The chance to discover a portrait of such a pivotal figure in British history by one of the greatest artists who ever lived has been thrillingly exciting.

“I hope it inspires many people to visit Glasgow’s museums, some of the finest in the country. ”

The rediscovered Rubens painting will go on display at Glasgow Museums’ flagship gallery, Kelvingrove, on Thursday, after the BBC4 programme has aired.

David McDonald, the chair of Glasgow Life, which runs the museums service, said: “Unsurprisingly, we are beyond delighted to discover the painting is by Rubens, an artist renowned globally as one of the most important painters in history.”

McDonald said Glasgow was proud of its extensive art collection and it had been a joy to work with the TV programme.

“We are excited to give as many people as possible the opportunity to see Rubens’s masterpiece in person,” he said. “George Villiers is sure to become one of the undoubted highlights of any visit to Kelvingrove.”

Karen Cornfield, the property manager for Pollok House, said it was exciting news for Glasgow. “We hope the programme will encourage visitors to come to Pollok, explore the collection and learn more about the family who brought so many great artworks to Glasgow,” she said.