1962-63 Ferrari 250 GTO Berlinetta
A 1962-63 Ferrari 250 GTO Berlinetta is parked at the Bonhams Quail Lodge car auction in Carmel, California. The car, reportedly one of only 39 made, sold for $38,115,000 (£22,844,830), making it the most expensive car ever sold at auctionReuters

A rare Ferrari made in 1962 has become the most valuable car in the world, as it fetched a record price at an auction held in California.

The Ferrari 250 GTO, which is one of only 39 made, was sold for $38m (£23m, €28m) at an auction conducted by auction house, Bonhams.

The price topped the previous record of a 1954 Mercedes-Benz W196 R F1 Racer, which was sold for $30m in 2013 at Bonhams' Goodwood Festival of Speed auction in Sussex.

"It's been a genuine privilege to represent this outstanding car and we are absolutely delighted with today's results," Bonhams chairman Robert Brooks said.

The car has been owned by the Ferrari and motor-racing enthusiast Violati family since 1965.

The GTO model is said to be one of the most desirable cars because of its styling and racing history. The car competed in a number of races including a tragic one in 1962, when former French ski champion Henri Oreiller was killed.

The car was severely damaged in the accident, but the family repaired it and continued to use it for racing events until very recently. Known by its chassis number 3851, the car was the 19th GTO completed on 11 September 1962. It was bought by Fabrizio Violati for around $4,000.

The GTO, which is the first to go on the auction block in several years, was expected to fetch a higher price, as another GTO reportedly changed hands for $52m recently.

The bidding started for the two-seat coupe, with a 3.0-litre, 300-horsepower V-12 engine, at $11m and hit $31m within a minute.

Current GTO owners include Ralph Lauren, Pink Floyd drummer Nick Mason, and Wal-Mart heir Rob Walton. They have held exclusive get-togethers in recent years.