The Duke of Edinburgh has had a recurrence of the bladder infection that he suffered in the summer and has been admitted to hospital for investigation and treatment.
The Duke was taken to Aberdeen Royal Infirmary on Wednesday afternoon as a "precautionary measure" and is likely to remain there for a few days, Buckingham Palace said.
A spokesman said Philip travelled to the hospital, about 40 miles away from Balmoral where he was staying with the Queen, by road.
The Duke went to Balmoral after attending a number of Olympics events, including granddaughter Zara Phillips' Olympic debut on 29 July.
The spokesman added: "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."
The scare comes two-and-a-half months after he spent five nights in hospital with a similar compaint following the Diamond Jubilee Pageant on the River Thames.
The 91-year-old royal underwent a successful procedure to clear a blocked coronary artery last December and was in hospital for four nights over Christmas.
Before the heart scare he had been fit and apparently healthy, and led the active life of a man of younger years.
In March this year his grandson Prince Harry said the operation had given him "a new spurt of life".
He was forced to miss some of the jubilee celebrations in June after he was admitted to hospital the day after braving the elements for the pageant.
Philip was at the Queen's side during the Opening Ceremony of the London Olympics on 27 July and the following when they toured the Olympic Park.
While in Scotland earlier this month he supported the Queen at engagements including hosting a tea party at Balmoral to mark the end of her Diamond Jubilee celebrations.
The hospital admission comes little more than a week after the Duke made a public appearance at a garden party in the north-east of Scotland.
Philip joined the Queen and the Earl and Countess of Wessex at the event on the Balmoral estate which was attended by around 3,000 guests.
The royals, including the Duke, reportedly looked relaxed during the event, which rounded off the Queen's Diamond Jubilee celebrations.
It was said to have been only the second time that the Queen's Deeside home, where the Royal family prize their privacy, was used for such an event.
The Duke appeared to be in good spirits as he took part in events as part of Cowes Week, in his role as Admiral and member of the Royal Yacht Squadron.
He viewed the racing in the Solent on Tuesday before attending a luncheon on board a yacht, the My Farragon, accompanied by the Lord-Lieutenant of the Isle of Wight, Major General Martin White.
On Monday, he had been at a luncheon held at Newport's Chamber of Commerce, then visited manufacturers AJ Wells and Sons in the town before having dinner at the Pavilion in Cowes.
The Duke also took part in several events during his and the Queen's annual week of engagements in Scotland last month.
He accompanied the Queen on a visit to the Scottish National Portrait Gallery and at a special thanksgiving service in Glasgow to mark her 60 years on the throne.
Philip joined several members of the Royal Family when his grandson, the Duke of Cambridge, was installed as a Knight of the Thistle at a service in Edinburgh.