Defence Secretary Philip Hammond admitted Prince Harry was moved to a guarded location when the attack on Camp Bastion began.
He told BBC 2's Newsnight:
Clearly there are fall-back plans and I can't go into the detail of them - but once we knew on Friday night that the perimeter at Bastion had been breached he would have been moved to a secure position under effective guard.
Clearly if we had a VIP in theatre and frankly if I was there or, Jeremy, if you were there in Camp Bastion and there was a breach of the perimeter security, anybody who might, by nature of who they are, be a target, they would be put in a secure location.
He is serving there as an ordinary officer but clearly there are additional security arrangements in place that recognise that he could be a target himself specifically as a result of who he is.
Prince Harry should not be withdrawn from his military role in Afghanistan, defence experts said.
Prince Harry was unharmed after an attack on the Camp Bastion military compound in Afghanistan in which two US Marines were killed.