Teenage brothers Somer and Areeb Umeed Bakhsh fled from Faisalabad to Glasgow with their family in 2012, after their father received death threats from Islamic extremists and two friends were murdered in the region on account of their Christian faith.
After being repeatedly denied asylum in the UK, the Church of Scotland launched two online petitions urging the UK government not to deport the brothers to their birth country where blasphemy carries the death penalty.
As a result of the campaign, which gathered more than 94,000 signatures, the home office has now granted the Bakhsh family "limited leave to remain" in the UK until February, 2022.
Somer Umeed Bakhsh has expressed his gratitude at the government's decision: "We have gone through a tough time and I am really happy that we now have the freedom to stay in the country we love.
"I feel like a weight has been lifted off my shoulders because the threat of deportation was always in the back of my mind.
"Scotland is my home, I have grown up here, all my friends are here and I feel like a Scottish boy.
"I am very thankful to everyone who has supported my family and the people who signed the petitions - we could not have got to this point without you.
"But I am disappointed that we will have to apply to the Home Office for an extension in just two and a half years."
Mr and Mrs Umeed Bakhsh will soon be granted work permits and have the opportunity to drive after previously being denied the right to seek UK employment.
Rev Linda Pollock, minister at Possilpark Parish Church in Glasgow, led the campaign to protect the family who are members of her congregation.
She said: "I am relieved and feel deep joy that this decision has been made because these youngsters have been living in a psychological prison and in bondage for too long.
"They are brave, inspirational, compassionate, intelligent, well rounded boys who have experienced sorrow and heartache.
The Church of Scotland has welcomed the news and is hopeful that this decision will signal "the beginning of the end of a seven and a half year struggle for the Christian family."
The family's case was raised with former Prime Minister Theresa May in the House of Commons by Paul Sweeney, MP for Glasgow North East, and in the Scottish Parliament by Bob Doris, MSP for Glasgow Maryhill and Springburn.
Mr Sweeney said he was delighted by the news and paid tribute to the Bakhsh family's church community for their support. He went on to say that the incident highlighted the fundamental changes that need to be made to Home Office policy.
"It is disgraceful that it should take a question to the Prime Minister, tireless work from my constituency staff and the solidarity of thousands of Glaswegians who signed the petition to get a result.
"However, whilst the family now have the freedom to work and contribute their talents to our community, they remain in a temporary state of limbo over the next decade before they can apply for permanent settlement.
"Prior to this they will be required to apply every 30 months for further leave to remain with each occasion costing approximately £8,000.
"That is a disgraceful financial burden and I will be campaigning in parliament to have these exploitative costs abolished."
First Minister Nicola Sturgeon described the brothers as a "credit" to Scotland.
Stay up to date with the latest news stories from a Christian perspective. Sign up to our daily newsletter and receive more stories like this straight to your inbox every morning.