At a time when tech companies are being blamed for creating housing shortages in cities across the country, Microsoft told The Seattle Times it will make a $500 million pledge, its largest ever, to create affordable housing around Seattle. The company is currently in the middle of a multi-billion=dollar expansion of its Redmond, Washington campus.

Microsoft’s pledge comes half a year after Seattle City Council failed to pass a “head tax” that would have required companies making more than $200 million a year to pay $275 per employee in taxes. The money would have been used to address housing issues and homelessness, but council members blamed the repeal of the new tax ordinance on Amazon, which said it would stop construction on a new building if it passed. Amazon is based in Seattle, but also is planning new headquarters in Arlington, Virginia and Long Island City, New York.

In an interview with The Seattle Times, Microsoft president and chief legal officer Brad Smith said the housing pledge grew out of conversations the company began having with Challenge Seattle, an alliance formed by 18 businesses to address civic issues in the area, last summer. Most of the funds will be used to increase housing for low- to middle-income workers across the Puget Sound region.

“At some level we as a region are going to need to either say there are certain areas where we’re comfortable having more people live, or we just want to permanently force the people who are going to teach our kids in schools, and put out the fires in our houses, and keep us alive in the hospital, to spend four hours every day getting to and from work,” Smith told the newspaper. “That is not, in our view, the best outcome for the community.”

Smith added that he hopes the pledge will help create “tens of thousands of units.” In addition to being the largest pledge ever made by Microsoft, which holds $135 billion in cash reserves and short-term investments, the company says it is one of the largest housing contributions ever by a private corporation.

The money will be used in three ways: $225 million will be loaned at below-market interest rates to developers building units for households making between $62,000 to $124,000 a year; $250 million will be used for market-rate loans to support the construction of affordable housing for people making up to 60 percent of the local median income, or about $48,150 for a two-person household; and the rest of the money, $25 million, will be donated to services for low-income and homeless people. Loans will be made over a period of three years and any profit will be put back in the fund.

Microsoft’s affordable housing initiative is partially modeled after Housing Trust Silicon Valley, which provides loans for affordable housing and services for the homeless in the Bay Area.