SEATTLE — Microsoft says it will devote $500 million to address a problem its own success helped create: the severe need for affordable housing in the Seattle area.

As the tech industry Microsoft brought to the region has boomed with the expansion of Amazon and other companies, the cost of housing has soared. Tent encampments packed with homeless people have become common, and even those with good middle-income jobs, such as teachers and nurses, have been priced out of the cities where they work.

“A healthy business needs to be part of a healthy community,” Microsoft President Brad Smith and Chief Financial Officer Amy Hood wrote in a blog post announcing the financial commitment. “And a healthy community must have housing within the economic reach of every part of the community, including the many dedicated people who provide the vital services on which we all rely.”

While $25 million will be used for grants to address homelessness, including money to provide legal help to those facing eviction, Microsoft isn’t simply giving away the rest of the money. Instead, it will provide market-rate or below-market-rate loans to developers who want to build affordable housing — the latter of which especially can make a big difference in what landlords charge for rent.

WATCH: High rents force some in Silicon Valley to live in vehicles

Microsoft’s initiative comes as Seattle’s tech giants face calls to help fix the region’s housing crisis. Last year, Seattle’s City Council passed a “head tax” on employee-hours at large companies — only to abruptly repeal it under pressure from Amazon. A few months later, Amazon founder Jeff Bezos announced a $2 billion contribution to start a fund that will open preschools in low-income neighborhoods around the U.S. and give money to nonprofits that help homeless families.

As the tech industry Microsoft brought to the region has boomed … the cost of housing has soared.

Other regions buoyed by the tech industry have faced similar challenges. New California Gov. Gavin Newsom called on Silicon Valley companies to match the $500 million he proposed in his first state budget with their own low-interest loans to developers that would go to build homes for middle-income residents.

In its announcement, Microsoft urged other companies, the state and local governments to step up and make it easier to build affordable housing. In conjunction, the mayors of nine cities east and south of Seattle — including Microsoft’s hometown of Redmond — pledged to tweak building codes and zoning, streamline permitting requirements, and make underused public land available for affordable housing.

Nancy Backus is the mayor of Auburn, a south Seattle suburb that has long had some of the cheapest housing in the area. But even there, she said, new homes run at least $565,000 — far above the city’s median of about $375,000. She called Microsoft’s commitment exemplary.

“The push of people leaving Seattle and leaving the Eastside because it’s no longer affordable has really started to have a strain on Auburn,” she said Thursday. “We’re very hopeful some of the funding that is being made available will help ease some of that burden and be able to keep affordable housing affordable.”

WATCH: Has urban revival caused a crisis of success?

She also noted that helping people live closer to their jobs reduces driving, helping the environment, and improves their quality of life, since they don’t have to spend so much time in their car.

Dan Bertolet, a housing policy researcher at the Seattle-based Sightline Institute, said the $225 million Microsoft is putting toward making loans at below-market-rate returns could have an especially big impact. His recent research suggested that having to repay loans at 2 percent interest, instead of 5 to 6 percent interest, could allow building owners to cut the rent they charge by roughly half, he said.

“A healthy community must have housing within the economic reach of every part of the community.”

Microsoft will loan the rest, $250 million, at market rate to finance construction of low-income housing.

Smith and Hood wrote that Microsoft had teamed up with the Seattle-based real estate firm Zillow over the past eight months to research housing data and that it had worked with others to study best practices for affordable housing around the world. Among the lessons: that providing short-term loans can help developers quickly acquire publicly owned land while they raise longer-term financing for construction.

“With these and similar investments, it’s possible to lend money, accelerate progress, be repaid and then lend this money again,” they wrote. “While this is just one of the many ways that we’ll seek to put money to good use, it illustrates our financial commitment can have a multiplier effect.”

Microsoft urged the state to double the $100 million budget for its Housing Trust Fund, which provides grants to developers of low-income housing.

AP writers Sally Ho in Seattle and Don Thompson in Sacramento, California, contributed to this report.