Warren Buffett Just Won a $1 Million Bet

In 2007, Warren Buffett bet a million dollars that an index fund would outperform a collection of hedge funds over the course of 10 years. This week he won that bet, but the big winner in the wager is a charity called Girls Inc.

When he placed the bet a decade ago Buffett said he would hand over any proceeds from the victory to charity. The charity he chose was his local Girls Inc. affiliate, The Wall Street Journal reports. The charity provides after-school care as well as summer programs for girls ages 5 to 18.

Buffett officially “won” the wager on Friday, but said throughout 2017 that he was confident that he would win. Over the course of the bet the S&P 500 index fund returned 7.1% compounded annually, significantly more than the basket of funds selected by an asset manager at Protégé Partners. That basket only returned an average of 2.2%.

Both Buffett and Protégé Partners originally put around $320,000 into bonds for the bet that was expected to appreciate to $1 million over the course of the 10 years. The bonds ended up appreciating faster than either party expected, and in 2012 the duo decided to purchase Berkshire B shares, which are now worth $2.22 million.

That influx of cash will mean big things for Girls Inc. — the charity currently has an annual budget of $2.8 million. The gift will help it provide a number of additional services, including helping to cover the expenses for transitional housing for 16 young women who are aging out of foster care.

Previously, Buffett has helped the organization by auctioning off some of his personal items.

Subscribe to Well Adjusted, our newsletter full of simple strategies to work smarter and live better, from the Fortune Well team. Sign up today.