OTTAWA -- The federal government has confirmed it will play a long-term role in affordable housing, ending several years of uncertainty over whether Ottawa would continue helping low-income families pay for their accommodation.

Finance Minister Jim Flaherty's spring budget commits Ottawa to five more years of funding through the Investment in Affordable Housing program.

The level of commitment is the same as in the past: $253 million a year over five years, which needs to be matched by the provinces and territories and can be spent on new construction, renovation, home ownership assistance, rent supplements, shelters and homes for battered spouses.

But there's a new twist to the funding. Home construction in the program will support the use of apprentices so that newcomers to the construction trades can build up crucial experience.

The budget also commits $100 million over two years to build 250 more units of affordable housing in Nunavut, where homes are so crowded that illness spreads easily and poverty abounds.

And the budget also confirms Ottawa's role in homelessness programming.

The document commits to five more years of funding for the Homelessness Partnering Strategy, although the funding levels are slightly lower than the previous commitment, coming in at $119 million a year instead of $134.8 million a year.

The focus for homelessness will be different too.

Ottawa has decreed a new emphasis on "housing first," a leading-edge approach to dealing with homelessness that pays or subsidizes homes for the homeless -- no questions asked -- and then follows up with a barrage of social services designed to keep recipients in their homes and build up their autonomy.

In the past, much of the homelessness funding went toward shelters or dealing with addictions and other problems before recipients were helped to find permanent homes.

But the federal government paid for the world's largest study on "housing first" to see whether it would be more effective in helping homeless people with mental illness and at the same time save governments money, especially for emergency services. The results were promising, and will now form the basis of federal policy going forward.

The affordable housing financial commitment from Ottawa is status quo, but that will be a surprise to many social housing advocates and anti-poverty advocates who feared the federal government was heading for the exits when it came to social housing.

That's because Ottawa has devolved the delivery of many social programs to the provinces and has resisted repeated calls for a national housing strategy, saying the provinces are closer to the ground and better able to know what low-income residents need.

Indeed, most of the funding announced in Thursday's budget will be transferred by Ottawa but spent by other levels of government, conditional upon their matching.

"Through targeted investments, the government will work with provincial and territorial governments, First Nations, not-for-profit organizations, and other stakeholders at the community level to increase accessibility and affordability of housing for those in need," the budget reads.