Prince Harry was on his way back to Britain on Saturday after news leaked that he had been fighting on the frontline in Afghanistan for the last ten weeks, the defense ministry in London confirmed.
"Following a detailed assessment of the risks by the operational chain of command, the decision has been taken ... to withdraw Prince Harry from Afghanistan immediately," the defense ministry said in a statement.
"This decision has been taken primarily on the basis that the worldwide media coverage of Prince Harry in Afghanistan could impact on the security of those who are deployed there, as well as the risks to him as an individual soldier."
The 23-year-old royal, a junior officer in the Household Cavalry, was posted in mid-December to the restive Helmand province in southern Afghanistan, where British forces are fighting Taliban insurgents.
"The Ministry of Defense can confirm that Prince Harry left Afghanistan earlier this evening," the ministry said in a statement early on Saturday. "He is now on his way home to the United Kingdom."
The grandson of Queen Elizabeth and third in line to the throne was sent to Afghanistan in December. But for security reasons and in agreement with the Ministry of Defense, the British media did not report his deployment.
That agreement collapsed after websites in Australia, Germany and the United States leaked the news on Thursday.
Harry's deployment to the war-torn country made him the first British royal to be sent into combat in more than a quarter of a century -- his uncle, Prince Andrew, served as a naval helicopter pilot during the 1982 Falklands War.
The blackout was agreed after the army was forced to cancel plans to send the prince to Iraq last year because of the security risk.
Pre-prepared interviews in Afghanistan were released Thursday after his mission was revealed, along with video of him firing a machine gun, using a field telephone, riding a motorcycle and playing football with fellow soldiers.
In one interview, the prince said there had been jokes about his nickname -- "bullet magnet" -- and acknowledged his tour could make him a "top target" for extremists. "Every single person that supports them will be trying to slot me," he said.
But he said he enjoyed being away from the glare of media publicity he faces at home, adding: "I think this is about as normal as I'm ever going to get."