Prince Harry has graduated from Sandhurst as an Army officer, where his passing out parade was inspected by his grandmother - the Queen.
The Duke of Edinburgh, Prince Charles and Camilla and Harry's brother William were also at the ceremony.
The 21-year-old, who last week joined Army pals at a lap dancing club near Slough, is to join the Household Cavalry's Blues and Royals.
Clarence House has released a series of photographs to mark his graduation.
The prince marched in the military college's Sovereign's Parade with 219 officer cadets.
The Queen stopped to have a few words with her grandson during the parade, after which he broke out in a broad grin.
He becomes a 2nd Lieutenant, his rank is referred to as a Cornet and he will serve in an armoured reconnaissance unit.
He will train to become a troop commander, in charge of 11 men and four light tanks, and could serve in a conflict zone.
Senior officer Maj Gen Sebastian Roberts said it was "eminently possible" the young royal could find himself serving in Iraq or Afghanistan.
Tradition dictates that the pips on his shoulder - one star signalling his rank as 2nd Lieutenant - remain covered up until midnight at the Sandhurst ball.
Prince William - also at Sandhurst - will be there ready to rip off the tape when the clock strikes midnight.
Clarence House insisted that Harry's South African girlfriend Chelsy Davy and Kate Middleton, who is William's partner, would not be there during the day.
Chelsy flew into Heathrow on Tuesday and she is believed to be accompanying Harry to the Sandhurst ball in the evening, along with Kate.
The Queen inspected both ranks of the senior division and the front rank of the junior division during the parade.
He took part in final training in Cyprus
Afterwards, she gave a speech to the cadets where she described the parade as a "great occasion".
"This day marks the beginning of what I hope will be highly successful careers," she said.
"My prayers and my trust go with you all."
She also presented the prestigious Sword of Honour to the best cadet and also handed out the Overseas Medal and the Queen's Medal, before addressing the newly-commissioned officers.
It was the first time in 15 years that she has attended a Sovereign's Parade in the quadrangle of the college in Camberley, Surrey.
The prince began training to be an officer in the Army last May.
Pictures released as he leaves Sandhurst were taken in Cyprus last month during battle training.
The prince has again been the subject of tabloid headlines in the last week.
The Daily Mirror and the Sun said the 21-year-old and his friends visited the Spearmint Rhino club near Slough to celebrate the end of his army training.