Prince Harry announced Tuesday he is to leave the British army after 10 years' service that has seen him fight on the front line twice in Afghanistan.

The 30-year-old said it had been a "really tough decision" to conclude his military service in June, but added that he was looking forward to a new chapter in his life.

His decision will come as a surprise to many royal-watchers as the prince was living out his boyhood dream and seemed quite content with the army life.

Harry, who will be nudged down to fifth in line to the throne by the birth of his brother Prince William's second child in April, will end his military service after a four-week secondment to the Australian Defence Force (ADF) in April and May.

"I am considering the options for the future and I am really excited about the possibilities," he said, in a statement released by his Kensington Palace official residence.

After his time with the Australian army, the prince will undertake an official tour of New Zealand, and then spend time doing voluntary conservation work in sub-Saharan Africa.

Before the end of the year, he then will begin volunteering with the British Ministry of Defence's recovery programme, supporting the rehabilitation of wounded service personnel -- a subject close to his heart.

The younger son of the heir to the throne Prince Charles and the late Diana, princess of Wales, Harry is keeping his long-term options open, and will continue to carry out part-time royal duties on behalf of his grandmother Queen Elizabeth II.

Difficult decision to leave

Harry graduated from the elite Sandhurst military academy and served twice in Afghanistan: once on the ground in 2007-2008 as a forward air controller calling in airstrikes and once flying attack helicopters in 2012-2013.

A captain commissioned in the Household Cavalry, he currently has a desk job organising commemorative army events in London.

"After a decade of service, moving on from the army has been a really tough decision," he said.

"The experiences I have had over the last 10 years will stay with me for the rest of my life. For that I will always be hugely grateful."

He added: "Inevitably most good things come to an end and I am at a crossroads in my military career.

"So while I am finishing one part of my life, I am getting straight into a new chapter. I am really looking forward to it."

Harry earned a reputation as a wild-child in his early 20s, with his party-going high jinks, but has since tried to carve out a more mature role for himself, with his devotion to military service playing a major part.

Dedication to wounded comrades

General Nicholas Carter, the professional head of the army, paid tribute to Captain Wales, as he is known in the military, praising his skill, judgment and professionalism in Afghanistan.

"He has been at the forefront throughout his service. He has insisted on being treated the same as his peers," the chief of the general staff said.

He also commended Harry for setting up the Invictus Games, the multi-sports event for wounded and maimed veterans.

"He has raised their profile through the care he has shown them and they admire him hugely," Carter said.

In Australia, Harry will be embedded with a number of Australian army units and regiments in Sydney, Darwin and Perth.

"We have prepared a challenging programme that will see Captain Wales deploy on urban and field training exercises, domestic deployments, as well as participate in indigenous engagement activities," said Air Chief Marshal Mark Binskin, Chief of the ADF.

Harry went to Australia during his gap year in 2003, where he worked as a "jackaroo" on a cattle station.

New Zealand Prime Minister John Key said he was "thrilled" by the planned royal visit to the realm, which is still in the planning stages.

"This is Prince Harry's first visit to New Zealand and we are very keen to show him as much of the country as possible," he said.

William, his wife Kate and their infant son Prince George were given a rapturous welcome when they toured the two countries last year.