Prince Philip's release from hospital came after five nights away from Balmoral following the recurrence of a bladder infection that he first encountered during the Diamond Jubilee.
The Duke was taken ill during his traditional annual summer break with the Queen at the royal family's Scottish estate.
During his time at the NHS hospital, he was not visited by Her Majesty or other family members after being advised by doctors to rest, but remained in regular contact with relatives by telephone.
The Duke of Edinburgh looked in good health as he left Aberdeen Royal Infirmary after six days in hospital receiving treatment for a bladder infection.
Prince Philip smiled as he shook the hands of staff members at the hospital and waved as he was driven away in a chauffeured Range Rover.
The Queen and members of the royal family have attended a church service at Crathie Kirk near Balmoral Castle, during the annual Royal summer break at Balmoral.The Duke was unable to attend the service as he remains in hospital receiving treatment for a bladder infection.
The Prince of Wales and the Duchess of Cornwall, known as the Duke and Duchess of Rothesay when in Scotland, have arrived ahead of the Sunday service at Crathie Kirk near Balmoral Castle, during the annual Royal summer break at Balmoral.
The Duke of Edinburgh will be unable to attend the service as he remains in hospital receiving treatment for a bladder infection.
Lots of tourists gathering here to join the congregation at Crathie Kirk, near Balmoral with the Queen.
The Duke of Edinburgh will miss a church service attended by members of the royal family, as his stay in hospital enters its fifth day.
The Queen is among those expected to attend the service at Crathie Kirk, near Balmoral, later today.
But Philip, 91, continues to receive treatment for a flare-up of a bladder infection at Aberdeen Royal Infirmary.
The Duke has so far not received any visits from his relatives after doctors on Friday advised him to rest.
He was admitted to the NHS hospital on Wednesday, during his and the Queen's annual summer break at Balmoral.
Officials said at the time that he would be in the infirmary for a few days and it remains unclear when he will be discharged.
He is said to have been in regular contact with members of his family by telephone.
The Duke of Edinburgh is due to spend a fourth night in hospital as his treatment for a bladder infection continues.
Prince Philip, 91, was admitted to Aberdeen Royal Infirmary on Wednesday, during his and the Queen's yearly summer break at Balmoral.
Officials said at the time that he would be in the NHS hospital for several days, and there are no signs that he will be discharged on Saturday.
On Friday doctors advised the Duke to rest, which means he has not had any visits from other members of the Royal Family over the weekend, although the hospital have said the Duke is in regular phone contact with his family.
Over the last few days the Queen has been spotted behind the wheel as she drives out and about driving while staying in Balmoral.
The Queen has been seen driving at the head of a convoy of Land Rovers several times since her husband the Duke was admitted to Aberdeen hospital, although it is not thought that she has been driving to visit him.
Police are advising the assembled press outside the Aberdeen hospital where the Duke of Edinburgh is being treated not to hold their breath for a Royal visit today.