The Duke of Edinburgh told medical staff he was heading home to enjoy the rest of his summer holiday after being discharged from hospital today following treatment for a bladder infection.
Philip was in good spirits as he left Aberdeen Royal Infirmary, where he has spent the past five nights being looked after by nurses and doctors.
The 91-year-old royal even joked with senior hospital managers, who had gathered to say goodbye to their famous patient, telling them to behave themselves.
Philip is famed for not wanting a fuss made about himself, and was praised by senior staff nurse Denise Webster.
Ms Webster, who was amongst the group of senior staff waving the Duke off, said: "The Duke was a very good patient, and as he left the hospital he told staff to behave themselves and he said he was going back to enjoy the rest of his holiday."
Philip's latest health scare came at the start of his traditional summer break with the Queen at her private Balmoral estate in Scotland.
He had travelled down to the Isle of Wight to spend the beginning of last week taking part in events during Cowes Week, in his role as Admiral and member of the Royal Yacht Squadron.
But after returning to Scotland he was taken last Wednesday by ambulance from Balmoral in the Cairngorms to the city hospital following a recurrence of a bladder infection.
In June he was admitted to hospital with the same infection the day after braving cold, wet and windy conditions on the royal barge for several hours during the Diamond Jubilee Pageant on the River Thames.
Philip spent five nights in London's King Edward VII Hospital and missed some of the key celebrations of a special bank holiday weekend marking the Queen's 60-year reign.
The Duke had recently recovered from a successful procedure to clear a blocked coronary artery last December, spending four nights in hospital over Christmas.
During his time at Aberdeen Royal Infirmary, he was not visited by the Queen or other family members after being advised by doctors to rest, but he was in regular contact with relatives by telephone.
Philip looked relaxed when he first emerged from the hospital and nearby was a large crowd of patients and visitors waiting to wave him off.
The royal shook hands with senior staff from the hospital lining his route to a Range Rover, including chief executive Richard Carey, medical director Dr Roelf Dijkhuizen and general manager Vincent Shields.
The Duke was dressed smartly in a jacket with a shirt and tie and took his place in the front passenger seat of the vehicle.
He returned the waves of the well-wishers as the car pulled away, and around an hour after setting off the Duke arrived back at Balmoral.
It is not yet known whether he will attend his next official engagement - accompanying the Queen to the opening of the London 2012 Paralympic Games on August 29.