A 1962 Ferrari 330 LM originally owned and raced by Ferrari's factory team went under the hammer on Monday and set a new record for a Ferrari sold at auction.

The auction run by RM Sotheby's saw the final bid come in at $47 million. With the buyer's fee included, the final sale price comes in at $51,705,000, eclipsing the previous record of $48.4 million for an ex-Phil Hill 1962 Ferrari 250 GTO sold by RM Sotherby's in 2018.

The 330 LM is a much rarer car than the 250 GTO and was expected to fetch around $60 million. A lesser 1963 250 GTO sold privately in 2018 for a rumored price of $70 million, and a 1955 Mercedes-Benz 300 SLR, one of only two Uhlenhaut Coupe examples, sold last year for over $140 million.

The 330 LM was a further development of the iconic 250 GTO, built to comply with changing FIA regulations. Only four were built, as Ferrari was preparing to move to a mid-engine platform, and only two were built with bodywork resembling the 250 GTO. The car that was just sold, which bears chassis no. 3765, is one of those two.

1962 Ferrari 330 LM bearing chassis no. 3765 - Photo credit: RM Sotheby's

1962 Ferrari 330 LM bearing chassis no. 3765 - Photo credit: RM Sotheby's

1962 Ferrari 330 LM bearing chassis no. 3765 - Photo credit: RM Sotheby's

1962 Ferrari 330 LM bearing chassis no. 3765 - Photo credit: RM Sotheby's

1962 Ferrari 330 LM bearing chassis no. 3765 - Photo credit: RM Sotheby's

1962 Ferrari 330 LM bearing chassis no. 3765 - Photo credit: RM Sotheby's

The 330 LM is easily recognized by the bulge in its hood to accommodate the larger 4.0-liter V-12 engine used in the 330 LM, instead of the 3.0-liter engine in the 250 GTO. The extra displacement bumped horsepower up to the 385-hp mark, which was a considerable jump over the 3.0-liter engine whose output lied closer to 300 hp.

Two different 4.0-liter V-12s were used in the car while it was raced by Ferrari. With its first engine, it found success in a 1,000-kilometer race at the Nürburgring in 1962, where it finished second overall and first in class. It was then upgraded with a new 4.0-liter engine for the 1962 24 Hours of Le Mans, the race from which the car takes its LM suffix. Chassis no. 3765 also wears the same livery it did for the 1962 Le Mans race, where it qualified in seventh place but failed to finish.

After Ferrari was done racing the car, it was sold in 1964 to Pietro Ferraro, who had Ferrari revert the car to a 3.0-liter V-12 so that it could be fielded as a GTO in Italian GT racing. Not long after, he sold the car to Ferdinando Latteri who raced it around Sicily, as well as in the 1965 Targa Florio, though he failed to finish.

Latteri sold the car back to Ferrari in 1967, and within a few months it made its way to the U.S. after being bought by California resident Mario Tosi. It then traded hands several times before ending up with Ohio resident Jim Jaeger in 1985, who was the seller at this week's auction. The car in its current state has the 3.0-liter V-12.