A painting originally valued at a few hundred pounds but later attributed to Spanish master Diego Velazquez fetched three million pounds at a London auction on Wednesday.

The hammer price was at the top end of pre-sale estimates set by Bonhams auctioneers, who discovered the portrait of an unknown gentleman among a collection of paintings believed to have been by British 19th century artist Matthew Shepperson.

The works were consigned for sale at Bonhams in Oxford, but experts suspected the portrait was by a different artist and sent it to the old masters department in London for further analysis.

Consultant Brian Koetser had his suspicions confirmed by Peter Cherry, lecturer at the History of Art department at Trinity College Dublin who Bonhams called one of the world's foremost authorities on Velazquez and his school.

After studying the painting, including with x-ray technology, Cherry decided it was by 17th century Spanish artist Diego Velazquez and dated from 1631-1634 when he was in Italy or shortly after he returned to Spain.

Bonhams said many experts were consulted in order to confirm the attribution to Velazquez.

It is one of only around 100 works by the painter known to exist, of which a handful remain in private hands.

Andrew McKenzie, director of old master paintings at Bonhams, said his involvement in the discovery and sale was a highlight of his career.

A spokesman said the work, featuring a balding man in black tunic and white golilla collar, had gone to a U.S. buyer.

The other highlight of the sale was Three Peaches on a Stone Ledge With a Painted Lady Butterfly by Dutch artist Adriaen Coorte, which fetched 2.1 million pounds, an auction record for the artist and well above estimates of 300-500,000 pounds. Overall the auction raised 6.3 million pounds.

More records tumbled at Christie's late on Tuesday, where The Battle between Carnival and Lent by Pieter Brueghel II sold for 6.9 million pounds and Willem van de Velde II's Dutch men-o'-war and other shipping in a calm fetched 5.9 million pounds.

But Francisco Goya's Portrait of Don Juan Lopez de Robredo, estimated to be worth 4-6 million pounds and billed as the star lot on the night, failed to sell.

The old master and British paintings auction raised a total of 24.1 million pounds, within expectations.

Later on Wednesday, rival Sotheby's holds its old master and British art sale, the last in a series of big auctions in London this week.

It expects The Card Players in an Interior by 17th Dutch artist Jan Steen to be the top lot at 4.5-6.0 million pounds, while a pair of works by 18th century painter Johann Zoffany commissioned by British actor David Garrick have a combined value of 6-8 million pounds.

Sotheby's expects to raise over 21 million pounds from the main auction and a smaller day sale on Thursday.

(Reporting by Mike Collett-White, editing by Paul Casciato)