The move by Apple follows similar initiatives from Silicon Valley peers Google and Facebook.
Apple said Monday it would commit $2.5 billion over the next two years to help address the shortage of affordable housing in California and reduce homelessness.
The move by Apple follows similar initiatives from Silicon Valley peers Google and Facebook, which each have pledged $1 billion for housing programs.
"Before the world knew the name Silicon Valley, and long before we carried technology in our pockets, Apple called this region home, and we feel a profound civic responsibility to ensure it remains a vibrant place where people can live, have a family and contribute to the community," said Apple chief executive Tim Cook in a statement.
"Affordable housing means stability and dignity, opportunity and pride. When these things fall out of reach for too many, we know the course we are on is unsustainable, and Apple is committed to being part of the solution."
Apple said data showed some 30,000 people left San Francisco between April and June of 2019 and that its efforts are geared to help "community members like teachers, firefighters, first responders and service workers" who cannot find affordable lodging.
Apple said it was working with California Governor Gavin Newsom on several programs to address housing and homelessness.
The iPhone maker said $1 billion will go to the state's affordable housing fund that will extend credit to develop and build additional housing faster and at a lower cost.
Apple also said it would make available land it owns in San Jose worth some $300 million for homes.
The company is committing $200 million to support new lower-income housing in the Bay Area, including $150 for a public-private partnership.
It will also offer $50 million to support the efforts to address homelessness in Silicon Valley with the nonprofit group Destination: Home.
"We have worked closely with leading experts to put together a plan that confronts this challenge on all fronts, from the critical need to increase housing supply, to support for first-time homebuyers and young families, to essential philanthropy to assist those at greatest risk," said Lisa Jackson, Apple's vice president for environment and social initiatives.