A failed Afghan asylum seeker is to receive £85,000 in damages to settle an unlawful detention claim, the High Court in Belfast heard.
Saeed Ullah sued the Home Office over being held twice with a view to being removed from the UK and returned to the war-torn region.
The 44-year-old, who now lives in Belfast as a naturalised British citizen, based his action on being denied access to a policy granting exceptional leave to remain. His legal team also argued that this resulted in his suffering a psychological adjustment disorder.
The settlement, involving an £85,000 payout plus legal costs, was confirmed ahead of a planned two-day hearing of the case.
After fleeing Afghanistan in 1999 Mr Ullah came to the UK and claimed asylum.
His application was rejected two years later, leaving him vulnerable to being returned to his country of origin because he had not established a claim for international protection.
However, at the time the Home Office had in place an Exceptional Leave to Remain (ELR) policy for failed Afghan asylum seekers.
Based on the wider conditions in the country, it remained in effect until 2002.
Mr Ullah argued that he was never told about the policy and that it should have been applied to him due to his nationality.
Instead, he was detained between June and July 2004 with the threat of being sent back to Afghanistan.
He was taken to the remand wing at HMP Maghaberry and then a temporary immigration centre on the Crumlin Road, Belfast.
Two years later he was held again at various detention centres in England and Scotland between September 2006 and March 2007.
Mr Ullah declined to comment following the resolution to his case.
But his solicitor, Jack Quigley of Madden and Finucane, said the action was part of wider legal proceedings issued to stop his removal.
"We strongly welcome today's settlement on behalf of our client who now feels vindicated for bringing his claim against the Secretary of State," Mr Quigley said yesterday.
"The failure to apply the policy to our client and grant him ELR was a material public law error.
"Hopefully this case will serve a valuable purpose in restraining the arbitrary and outrageous use of executive power in similar such circumstances in the future," Mr Ullah's solicitor added.