Queen Elizabeth II and Prince Andrew have visited Prince Philip in the London hospital where he is being treated for a bladder infection.
Earlier, Buckingham Palace said Duke of Edinburgh’s condition had “improved considerably” but he was likely to stay in the King Edward VII Hospital for a few days.
Prince Philip, 90, has spent two nights in hospital, missing the end of the Diamond Jubilee celebrations.
A Buckingham Palace spokesman said the duke was in “good spirits”.
The duke was admitted to hospital on Monday, hours before the Jubilee Concert outside Buckingham Palace.
On Wednesday, the Queen attended a lunch with Commonwealth leaders, as she continued to mark 60 years of her reign.
Prime Minister David Cameron was among the 70 guests at the lunch, at Marlborough House on Pall Mall.
The engagement saw a protest by some members of the UK’s Tamil community, as Sri Lankan president Mahinda Rajapaksa arrived. They were demonstrating about the country’s record on human rights.
The duke, who had treatment for a blocked coronary artery in December, turns 91 on Sunday.
A palace spokesman said earlier: “The treatment of his infection continues with antibiotics.
“He is likely to remain in hospital over the next few days. He is in good spirits.”
The Queen arrived at the hospital, in central London, at 17:10 BST and left at 17:55. The Duke of York left the hospital at about 18:40 BST.
Prince Andrew told reporters that his father was “mending very well”.
Meanwhile, the Prince of Wales, who earlier opened a sheep industry show in Scotland, told well-wishers the duke was “doing well”.
Dorothea Holland, 60, from Stranraer in Galloway, said she asked Prince Charles how the duke was.
“He said he was doing well and thanked me for asking. He just said it was a shame that he hadn’t been able to take part yesterday, and said they had all had a very busy few days,” she said.
On Tuesday, the Earl of Wessex, his youngest son, said the duke was “feeling better” and had been watching the Jubilee events on television.
Asked how the Queen was coping without her husband, Prince Edward added: “She’s bearing up but missing him, obviously.”
As well as the concert, which saw performances from artists including Stevie Wonder and Sir Paul McCartney, the duke missed the national service of thanksgiving at St Paul’s Cathedral on Tuesday.
In his sermon, the Archbishop of Canterbury said “our prayers and thoughts” are with the duke.
The service was followed by receptions at Mansion House and the Guildhall, a lunch at Westminster Hall and a carriage procession to Buckingham Palace, then by a balcony appearance by the Queen, the Royal Family and a flypast.
Buckingham Palace said Prince Philip was “understandably disappointed” about missing the rest of the celebrations.
On Tuesday evening the Queen released video message to the nation, describing the four days of celebration as a “humbling experience”.
“It has touched me deeply to see so many thousands of families, neighbors and friends celebrating together in such a happy atmosphere,” the Queen said.