The Duke of Edinburgh is being treated in hospital after a recurrence of the bladder infection he had in the summer.
Prince Philip was taken to Aberdeen Royal Infirmary while staying with the Queen at her retreat at Balmoral, a spokeswoman said.
In a statement the palace said: "The Duke of Edinburgh has had a recurrence of the bladder infection that he had in the summer and has been admitted to hospital for investigation and treatment.
"His Royal Highness is likely to remain there for the next few days."
The 91-year-old royal consort made the journey of almost 50 miles from the castle in the Cairngorms to the city hospital by road in an ambulance, the palace said.
The Duke's latest health scare came two and a half months after he spent five nights in hospital with a bladder infection following the Diamond Jubilee Pageant on the River Thames.
He was forced to miss some of the celebrations for Her Majesty's 60 years on the throne after he was admitted to the King Edward VII Hospital in central London.
He also underwent a successful procedure to clear a blocked coronary artery in December 2011 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, his grandson Prince Harry said the operation had given him "a new spurt of life".
The Duke of Edinburgh went to Balmoral after attending a number of Olympic events. He was at the Queen's side during the Opening Ceremony on July 27 and the following day when they toured the Olympic Park.
He then watched his granddaughter Zara Phillips' Olympic equestrian debut on July 29 and was at the ExCel exhibition centre a few days later to watch boxing.
A royal 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."
On Deeside, where the Queen's estate is situated, residents thoughts were firmly with the Duke and the Royal family.
One woman said: “I think the majority are thinking about him and wishing him the best. He’s done very well with the Queen and supporting her and [we] just hope he gets well quick.”
Another resident added: “[It’ll be a] worrying time I would think especially at his age.”
The Duke appeared to be in good spirits as he took part in events as part of Cowes Week on the Isle of Wight, 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.
While in Scotland earlier in August he supported the Queen at engagements including hosting a tea party at Balmoral. Prince Philip joined the Queen and the Earl and Countess of Wessex at the event on the estate which was attended by around 3 000 guests.
It is not known whether or not other members of the royal family were also staying at Balmoral.
A Buckingham Palace spokesman said: "It is usual for other members of the royal family to be in residence at Balmoral with the Queen during the summer period but we do not know who would be there."