SAS sniper Sergeant Danny Nightingale has been recommended for medical discharge.
The Medical Board of the British Army recommended the 38-year-old should be medically discharged as a result of serious brain damage caused following his collapse in the Amazon jungle in 2009, said his lawyer Simon McKay.
In a statement issued through Mr McKay, Sgt Nightingale said he was "devastated" that his SAS service had come to an end, but he recognised the brain damage he suffered in 2009 meant he could no longer carry out his normal duties.
The news comes a day after a judge ruled that Sgt Nightingale will face a retrial over illegally possessing a pistol and ammunition - despite a last-minute claim that prosecutors acted improperly by consulting on the case.
On Wednesday he pleaded not guilty to illegally possessing a Glock 9mm pistol and more than 300 rounds of ammunition. Sgt Nightingale, from Crewe, was convicted and sentenced to military detention last year before having his sentence reduced and conviction quashed by Court of Appeal judges. He now faces a retrial in July.
Sgt Nightingale has said the gun and ammunition was sent back to Britain by other soldiers after he had to return from Iraq with the bodies of two comrades. He later suffered brain damage while on a fundraising marathon in the Amazon.
In his statement on Thursday, the father-of-two said: "I am obviously devastated by the news that my service in the SAS has come to an end and I am to leave the British Army after 18 years of loyal service.
"However I now recognise that the permanent brain damage I suffered in 2009 means that I can no longer carry out my normal duties. Once the Court Martial is resolved, I can begin to plan how I can rebuild my life."
His wife, Sally, said: "Danny belonged to one of the finest regiments in the world because he is a fighter. Although he is obviously upset that his career is over, we'll get through it together and, once the Court Martial is over, start his reintegration to civilian life.
"A bigger question for me is how the Service Prosecuting Authority felt able to say repeatedly during the Court of Appeal proceedings that Danny had been certified fit for duty when it is clear that the opposite was in reality the case."