Pink Floyd frontman David Gilmour sold his guitars for $21 million at auction on Thursday to raise money for a nonprofit fighting climate change.

Gilmour, the guitarist, singer, and songwriter of the legendary English rock band, offered the largest and most comprehensive sale of guitars ever offered at auction, according to Christie’s, which sold the instruments.

On Wednesday, Gilmour announced all proceeds would go to ClientEarth, a “charity that uses the power of the law to protect the planet and the people who live on it,” according to its website.

David Gilmour performs live at the United Center on April 4, 2016 in Chicago. Rob Grabowski / Invision/AP file

On Twitter, Gilmour said he chose ClientEarth because “the global climate crisis is the greatest challenge that humanity will ever face, and we are within a few years of the effects of global warming being irreversible.”

Gilmour sold a total of 126 items, including the iconic “black strat” guitar, which for nearly $4 million, far exceeding its pre-sale estimate of $150,000. Gilmour purchased the “black strat” in New York in 1970, and it was used to record “Dark Side of the Moon,” according to Caitlin Graham, a Christie’s consultant.

ClientEarth CEO James Thornton expressed his gratitude for Gilmour’s donation in a statement: "This is a truly humbling and extraordinary gift, which goes beyond our wildest expectations. It’s difficult to express just how deeply grateful we are to David for choosing ClientEarth as the beneficiary of this historic auction.”

“We need a civilised world that goes on for all our grandchildren and beyond in which these guitars can be played and songs can be sung,” Gilmour said on Twitter.