(CNN) Pink Floyd's David Gilmour auctioned 126 of his guitars for a record-breaking $21 million at a New York charity auction Thursday to fight against climate change.

The auction lasted eight hours and had bidders from 66 countries around the world, according to British auction house Christies , which handled the sales.

"The Black Strat," a 1969 Fender Stratocaster which Gilmour used to record Pink Floyd albums "The Dark Side of the Moon," "Wish You Were Here" and "The Wall," sold for $3,975,000 -- a new world record for a guitar at an auction.

A red 1984 Fender Stratocaster belonging to Pink Floyd guitarist David Gilmour was auctioned for $615,000 at Christie's in New York City.

Gilmour bought the guitar in May 1970 to replace his first black Stratocaster, which had been purchased only six weeks earlier, but was stolen in New Orleans on tour along with the rest of Pink Floyd's equipment. He purchased the guitar new at Manny's, an iconic New York City guitar store where many famous musicians bought instruments.

The replacement Stratocaster differed slightly from the stolen one because it had a maple neck instead of a rosewood neck. Over the years, according to Rolling Stone , Gilmour made several changes to the instrument to get the perfect sound.

Gilmour's rare 1958 Gretsch White Penguin sold for $447,000, a new auction record for a Gretsch guitar.

"You know something? For me, I can let go of it," Gilmour told Rolling Stone. "It's going to bring a lot of people to have a look at this sale, and it's going to do that job. It's a lovely guitar. ... I did my 'Comfortably Numb' solo on it. The notes for the beginning of 'Shine On You Crazy Diamond' fell out of it one day.

Indianapolis Colts owner Jim Irsay made the winning bid for the collectible item.

He tweeted about the instrument's history and how honored he was to bring the piece to the public.

The incomparable David Gilmour.. the greatest "phrasing" guitarist in the world!! Honored to bring The Black Strat to the public. The most expensive guitar EVER purchased. And for charity!!! — Jim Irsay (@JimIrsay) June 20, 2019

Gilmour's stash of 126 instruments collectively sold for $21,490,750.

"The choice really is that simple, and I hope that the sale of these guitars will help ClientEarth in their cause to use the law to bring about real change," he explained on Twitter.