The Home Office has backed off trying to deport a Singaporean doctor who has lived in the UK years for 10 years and is five months from qualifying as a GP.
Manchester-based Dr Luke Ong, 31, said he was "cautiously optimistic" after the Home Office said it was withdrawing its legal case to deport him.
He was refused the right to remain in September because his application was 18 days late due to a mistake.
The British Medical Association (BMA) described it as "an honest oversight".
Dr Ong won an appeal but the Home Office was due to challenge this victory in a higher court which it is now withdrawing.
A Home Office spokeswoman said: "Dr Ong's case has been reviewed following further representations. The Home Office has applied to withdraw from the ongoing appeal proceedings and will reconsider his application for Indefinite Leave to Remain (ILR)."
Dr Ong said: "It is a relief but I will not believe it until I see the final documents from the Home Office. I have been here before."
His parents paid nearly £100,000 towards his seven years of medical training in the UK, which was part-funded by the British government.
The initial decision to refuse Dr Ong's application was in line with the UK's immigration rules, as he did not have 10 years' lawful residency at the point of application.
Chaand Nagpaul, BMA council chair, said: "We are pleased that the government has seen sense and backed away from trying to deport someone who has spent the last decade dedicating himself to a career in the NHS.
"The strong reaction to Dr Ong's case from both healthcare professionals and members of the public highlighted the absurdity of a system that would seek to remove a valued doctor from the country over an administrative error.
"There is a serious shortage of GPs in England, and as we said in our letter to the Home Secretary about this case, any immigration system must be flexible and practical in its approach to hiring doctors born overseas if we are ever to solve the NHS workforce crisis."