Prince Harry will leave the Army in June, Kensington Palace has confirmed.
He has been in the military for ten years and says he is looking forward to a "new chapter" in his life.
During that time he was sent to Afghanistan twice, most recently in 2012 as an Apache helicopter co-pilot and gunner.
In a statement the prince said he was at a "crossroads" and quitting the Army had been a "really tough decision".
He said: "I consider myself incredibly lucky to have had the chance to do some very challenging jobs and have met many fantastic people in the process."
When he leaves the Army in June, Prince Harry will do voluntary work with a conservation project in Africa and with disabled veterans back in the UK.
General Sir Nicholas Carter, the professional head of the Army, paid tribute to the prince.
He said: "Captain Harry Wales, as he is known affectionately in the Army, has achieved much in his 10 years as a soldier."
"He has been at the forefront throughout his service. He has insisted on being treated the same as his peers."