The Duke of Cambridge is to become an air ambulance pilot next spring, it has been announced.
Kensington Palace said Prince William will join the East Anglian Air Ambulance flying both day and night shifts.
It will become his main job, but his rota will take into account any duties he will continue to undertake on behalf of the Queen.
A spokesman said the duke was "hugely excited and motivated" by the role.
"The duke sees this as a true form of public service, helping people in their most difficult times," he said.
"He regards his work with the RAF search and rescue force as having been an exceptional privilege and the duke wanted to make his own contribution to the outstanding work of the air ambulance service."
The charity's chief executive, Patrick Peal, said: "We're delighted His Highness has decided to fly with us.
"We are confident this will help raise the profile of the charity and other air ambulance charities in the region and across the UK."
The charity said the duke would be based at Cambridge Airport and fly missions in Cambridgeshire, Norfolk, Suffolk and Bedfordshire.
He will be paid a salary which he will donate in full to the charity, Kensington Palace said.
Peter Hunt, BBC News royal correspondent
For a second time in his life, the man who will be king will take on a role on merit and not because he has inherited it.
It will, according to one of those close to him, give Prince William a renewed sense of purpose.
The pilot prince will work for the East Anglian Air Ambulance for at least two years. He is, apparently, fully committed to remaining in the job for as long as he can.
This career choice - away from the tried and tested royal path of unveiling plaques and planting trees - is a reminder that William is, in the words of one official, "two heartbeats away from the throne". Being heir-but-one gives him the freedom that Prince Charles never enjoyed.
William is exploiting this flexibility to the full and will continue to do so until destiny calls.
Cambridge Airport is well placed between the Duke and Duchess of Cambridge's new home at Anmer Hall in Norfolk and their apartment at Kensington Palace.
There had been speculation surrounding the move since Prince William, who is qualified to be a captain or pilot of a Sea King helicopter, ended his active service as an RAF search and rescue pilot last September.
During his service he carried out more than 150 missions and completed more than 1,300 flying hours.
His main duties will involve flying an EC145 T2 aircraft and working alongside medics to respond to emergencies ranging from road accidents to heart attacks.
In order to gain this licence, the prince must complete five months of training followed by 14 exams and a flight test.
Initially he will be employed as a co-pilot but, after a period of training, he will be qualified as a helicopter commander.
Alastair Wilson, the charity's medical director, said: "He will be looking after patients with conditions that would be horrifying for many and some pilots may not like that very much.
"Compared to his role as a search and rescue pilot, he may be dealing with more injury patients than he is used to, but I'm sure he will adapt very well to that."