A red 1962 Ferrari 250 GTO Berlinetta has set the world record for a car sold at auction, going for $38.1m at a sale in California, auction house Bonhams said. 

The price offered by a bidder whose identity was not disclosed surpassed the $30m paid last year for a1954 Mercedes Benz W196 race car, also sold by Bonhams, the auctioneers said. 

"We've always maintained that we would exceed the current world record and that the car would bring between $30-$40m and today the GTO did just that," Robert Brooks, chairman of Bonhams, said. 

Some reports prior to the auction had said the car might make as much as $70m, but a Bonhams spokeswoman said these were based purely on speculation. 

The Ferrari was the jewel in the crown for Bonhams' annual Quail Lodge event on the Monterey Peninsula in California. 

The auction house said that it was the world's longest single-ownership for a Ferrari 250 GTO Berlinetta, effectively held by one family for 49 years from 1965 to 2014. 

The car sold from the Maranello Rosso Collection and stamped with chassis number '3851 GT' was the 19th 250 GTO Berlinetta made by Ferrari and completed on September 11, 1962, Bonhams said. 

It was delivered to the leading French racing driver Jo Schlesser, to be co-driven by himself and French ski Champion Henri Oreiller in the 1962 Tour de France Automobile. 

Oreiller later crashed the car during a race at Montlhery Autodrome, south of Paris, and died of his injuries in hospital. A newspaper report at the time said the Ferrari careered off the track and flipped twice after a tyre burst. 

The car was repaired by Ferrari in Italy and was sold to Italian driver Paolo Colombo in time for the start of the 1963 competition season. 

In 1965 young Fabrizio Violati, the son of a wealthy Italian family, bought the car. "I saved the car from scrap and hid it from my parents. I only drove it at night so nobody would see me", Bonhams quoted him as saying. 

For almost 40 more years, Violati drove the Ferrari in classic car and historic racing events, and it became one of the last 250 GTOs to compete regularly into the 2000s, until his death in 2010, the auction house said.