Denzel Darku, 23, moved from Ghana aged 14 and has served in the Scottish Youth Parliament. He was threatened with deportation but has now been granted permanent residence.
His case was raised by politicians and earlier this week Home Secretary Sajid Javid said he was "sympathetic" to Mr Darku's case.
A Home Office spokesman confirmed residence had been granted after a review of the case. He said: "We have contacted Mr Darku's legal representatives today to advise that, following reconsideration of his case, his application for permanent residence has been granted."
"His life has been turned upside down for no reason and lessons must be learned by the Home Office in how they treat people in future.
"I hope the interest in this case - and the Windrush scandal - results in a new approach to immigrants who make their lives here.
"The cruel and unacceptable treatment of people like Denzel in pursuit of politically-driven targets must stop."
Scottish Conservative leader Ruth Davidson said: "This is good news. I'm delighted for Mr Darku and grateful to the Home Secretary for giving this his personal attention in recent days."