A portrait of French emperor Napoleon Bonaparte, thought lost for two centuries, has turned up in New York, having been bought for less than a hundredth of its probable value.

The artwork, painted by Jacques-Louis David in 1813 when Britain and Prussia were threatening to occupy France, shows Napoleon I pledging to defend the country from invasion, wearing his national guard uniform to do so.

He is posing, as was his habit, with his right hand in his waistcoat.

Thought to be a copy, the painting was sold in 2005 to a New York private collector for around £15,000 ($24,000, 18,000 euros).

The buyer had it cleaned then asked French art expert Simon Lee from the University of Reading, west of London, for his help in authenticating it.

He compared it to copies and other David paintings.

“Although the painting is signed with David’s genuine signature, the cleaning revealed the word Rouget and the date 1813 appeared in the underpaint,” Lee said.

Georges Rouget was David’s preferred assistant for almost 10 years, and had a role in putting images on the canvas.

“Some collectors or museums might be put off by having two names on the canvas — but in many ways that is proof that it is an authentic product of David’s working process.”

The portrait had been in the Borthwick-Norton family at their castle outside Edinburgh and was gifted to the Royal Scottish Academy in 1988.

“Our collection policy is for Scottish arts and Scottish items so we don’t collect work by European artists,” an RSA spokesman told AFP.

“It was valued by a number of auction houses, and experts looked at it and it was given the status of being a copy.”

Now it seems the academy has missed out on a small fortune. The painting is thought to be worth more than £2 million ($3.2 million, 2.4 million euros).

David was one of Europe’s foremost painters from around 1780 until his death in 1825.

“I am thrilled to have discovered this beautiful painting which offers a unique insight into the role that art could play at a time of war,” said Lee.

“By having his portrait painted in national guard uniform, Napoleon was promoting himself as protector and defender of the nation at the time when France was under great threat.

“David produced an image of the emperor to galvanise resistance and foster patriotism, yet the painting never reached a wide audience because of the unexpectedly swift allied invasion that ensured the image remained uncirculated and practically unknown.”