Prisoners released from three Scottish jails are to get help finding accommodation, after an initiative headed by Shelter Scotland was awarded £889,317 in lottery cash.

The housing charity will work with Sacro (Safeguarding Communities, Reducing Offending) and Inverness Citizen's Advice Bureau in a scheme which the charities say will help cut reoffending as well as homelessness.

More than 1800 offenders from Perth, Aberdeen and Inverness prisons, will be offered housing support and advice by the Prisoners Advice Network Scotland (SPAN Scotland) over the next three years, both before and after they finish their sentences. They will be given help to find housing and also with other problems, such as mental health issues and substance misuse. Families of prisoners will also be given support in claiming housing and other benefits.

Charities say poverty, a shortage of social housing, and the fact that ex-offenders can be seen as undesirable tenants can mean they are more likely to become homeless. Yet tackling the lack of stable accommodation for former prisoners will help break a cycle of reoffending and help such men reintegrate into society, they claim. A 1999 study found that fewer than a third of prisoners who had homes to go to were reconvicted, compared with more than two-thirds of those without housing.

Graeme Brown, director of Shelter Scotland, said: "The funding will enable us, along with Sacro and Inverness CAB, to provide high quality, comprehensive advice, advocacy and support on a range of housing issues for prisoners and their families.

"Preventing homelessness amongst prisoners helps prevent reoffending. Keeping people out of prison has not only social benefits but also economic benefits – reducing the burden on the public purse by £44,447 per prisoner, per year.

"This project will support prisoners to maintain their accommodation through their prison sentence, responsibly give up their accommodation where appropriate and help them access housing and support on release from prison. This project will play a vital role in helping prevent prisoners and their families from becoming homeless."

The scheme was welcomed by Stuart McKechnie, who has benefited from help provided by Shelter's Prison Advice project. Mr McKechnie was unable to pay his rent during a short prison sentence and almost lost his council flat and all his personal belongings. The project was able to help him access a housing benefit fund for prisoners who are serving a sentence of less than 13 weeks.

He said: "I felt hopeless. There wasn't much I could do about the eviction from prison and didn't know where to turn. If I had lost my home I wouldn't have had anywhere else to go when I got out of prison.

"Having a home to go back to gave me the stability I needed to rebuild my life."

The Big Lottery Fund is providing funds for the programme. The fund also announced a £358,054 grant for Skye & Lochalsh Community Care Forum, to allow it to help more than 100 young carers.

Big Lottery Fund Scotland chair Maureen McGinn said the total of £1.2m in grants would help those most in need: "In Aberdeen, Inverness and Perth, today's funding will help ex offenders and their families to find accommodation as a means of providing stability and preventing the revolving door back to prison.

"Across the wider Highlands region over one hundred young carers will also benefit from this investment giving them the time and space to explore their own ambitions and enjoy some well deserved respite," she added.