An anonymous gift left in a will to the Community Foundation for Ireland will house more than 100 people in Limerick and Galway.
It has been announced that the Peter McVerry Trust and Threshold will jointly receive €1.5 million.
The donation will enable the Peter McVerry Trust to fit out 14 modular units in Moyross in Limerick. A further 32 homes will be fitted out across Co Galway.
Both charities welcomed the donation and described it as transformative.
CEO of Peter McVerry Trust Pat Doyle said it would enable the trust to deliver on its goal of providing more pathways into housing for people impacted by homelessness in communities across the west of Ireland.
"The funding will enable us to help over 100 people move into a high-quality social housing unit with ongoing support from Peter McVerry Trust tenant support team," Mr Doyle said.
Chief Executive Officer of Threshold John-Mark McCafferty said the donation would make "a real and lasting difference" to people and families at risk of homelessness across the country.
"The direct benefits will be the re-development of our Housing Advice centres in Dublin and Galway and the creation of an entirely new service and advice centre in Limerick," Mr McCafferty said.
The Community Foundation for Ireland says a donation of this kind responds to immediate need while focusing on longer-term solutions.
By partnering with the Peter McVerry Trust, the Foundation's CEO Denise Charlton says the anonymous legacy gift means over 100 people will be offered homes.
"This on its own is a significant achievement. However, our donor is also supporting initiatives with Threshold which have the potential to change the housing debate in Ireland forever," Ms Charlton said.
The Community Foundation for Ireland says that legacy gifts to charity in Ireland are low at 6%. This highlights the scale and generosity of the gift that will help the McVerry Trust and Threshold, according to the organisation.
The Foundation has called on the Government to grow "this type of giving in Ireland" by delivering a long-promised National Policy on Philanthropy.
The Foundation says it provided over €18.7 million in grants last year alone.