The Duke of Edinburgh, who is 91, was driven by ambulance to Aberdeen Royal Infirmary while staying at Balmoral with the Queen, a spokesperson said.
The duke originally suffered the infection shortly before the Diamond Jubilee concert on 4 June.
Prince Philip is likely to remain in the NHS hospital for the next few days
Prince Charles and the Duchess of Cornwall are at their private residence of Birkhall on the Balmoral Estate, while the Earl and Countess of Wessex are at Balmoral with the Queen.
It is not known whether other royals are there, but a palace spokesman said it was usual for members of the royal family to be in residence at Balmoral during the summer period.
The duke has been seen at public engagements in Cowes over the last few days.
Michael Dunkason, from Ryde on the Isle of Wight, saw him come ashore from the Galatea to Cowes at about 09:00 BST on Wednesday morning. He said Philip was “steadily walking up the steps and walked briskly along the jetty”.
He said: “The duke seemed in very good spirits and gave a final wave before entering the car.”
It is the third time Prince Philip has been in hospital in the last nine months: he also spent four days in hospital over Christmas, following an operation to clear a blocked heart artery.
In March, Prince Harry said the operation – which was successful – had given his grandfather a “new spurt of life”.
Later, in June, after braving the elements during the Jubilee boat pageant to mark the Queen’s 60-year reign, Prince Philip was forced to miss several days of festivities after being admitted to hospital for five nights with the bladder infection.
Since then he has been in apparently good health, joining the Queen at the Opening Ceremony of the London Olympics on 27 July, and touring the Olympic Park.
Prince Philip had travelled to Balmoral after viewing a number of Olympic events, including his granddaughter Zara Phillips’s equestrian competition on 29 July.
A Buckingham Palace spokesman said: “He has been resident at the castle for a short while, but whilst he has been there, he has also undertaken engagements on the Isle of Wight.”
As Admiral and member of the Royal Yacht Squadron, the duke has been taking part in Cowes Week on the Isle of Wight this week.
On Tuesday, he watched races in the Solent and accompanied Lord-Lieutenant of the Isle of Wight, Major General Martin White, for a lunch on board a yacht.
The previous day, he also met members of Newport’s Chamber of Commerce and visited manufacturers AJ Wells and Sons.
Earlier this month, he was at the Queen’s side for engagements in Scotland, helping to host a garden party for around 3,000 guests at Balmoral, marking the end of the Jubilee celebrations.
Prince Philip is the longest-serving royal consort in British royalty.
In the Queen’s Jubilee address to Parliament in March, she praised her husband for his devotion.
She said: “During these years as your Queen, the support of my family has, across the generations, been beyond measure.
“Prince Philip is, I believe, well known for declining compliments of any kind. But throughout he has been a constant strength and guide.”
Image source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…