A statement issued by the palace just after midday spoke of the Queen’s “deep sorrow” following his death at Windsor Castle on Friday morning.
The Duke of Edinburgh, the longest-serving royal consort in British history, was at the Queen’s side for more than her six decades of reign.
Boris Johnson said he “inspired the lives of countless young people”.
“It is with deep sorrow that Her Majesty The Queen announces the death of her beloved husband,” the palace said.
“The Royal Family join with people around the world in mourning his loss.”
Speaking at Downing Street, the prime minister said that the duke had “earned the affection of generations here in the United Kingdom, across the Commonwealth, and around the world”.
Meanwhile, Justin Welby, the Archbishop of Canterbury, said he “consistently put the interests of others ahead of his own and, in so doing, provided an outstanding example of Christian service”.
The flag at Buckingham Palace was lowered to half-mast and a notice was posted on the gates following the announcement of the duke’s death.
People placed floral tributes outside the palace, while hundreds visited Windsor Castle to pay their respects.
However, the government has urged the public not to gather or leave tributes at royal residences amid the coronavirus pandemic.
The BBC’s royal correspondent Nicholas Witchell said it was “a moment of real national sadness” and “a moment of sadness, most particularly of course, for the Queen losing her husband of 73 years – a bigger span of years than most of us can imagine”.
He said Prince Philip had made “a huge contribution to the success of the Queen’s reign”, describing the duke as “utterly loyal in his belief in the importance of the role that the Queen was fulfilling – and in his duty to support her”.
“It was the importance of the solidity of that relationship, of their marriage, that was so crucial to the success of her reign,” he added.
A bank of photographers and cameramen were lined up around the growing number of tributes at Buckingham Palace on Friday afternoon, said BBC News reporter Marie Jackson.
Rhea Varma, from Pimlico, pulled up to the gates on her bike to lay flowers and a note saying Rest in Peace Duke.
She said the news was “super sad”. To her, the duke was “the kind of stability that’s so old-fashioned it’s difficult to comprehend. He was a rock who brought integrity.”
Adam Wharton-Ward, 36, also arrived to leave lilies by the palace gates. He is visiting London from his home in France but was so moved by the news, he wanted to “rally round” for the Queen’s sake.
“It’s so sad. He’s been with her for 73 years. If it wasn’t for him who knows if she would have got through it,” he said.
The duke’s appeal, he added, was that he was “almost normal with his gaffes”.
“Now that normality has gone,” he said.
The prince married Princess Elizabeth in 1947, five years before she became Queen.
In March, the duke left King Edward VII’s hospital in central London after a month-long stay for treatment.
He underwent a procedure for a pre-existing heart condition at another London hospital – St Bartholomew’s.
This is a town that’s seen many royal events over the years, both happy and sad.
Today, it is one of quiet reflection.
The sun has been shining down on Windsor castle this afternoon, but the mood outside is understandably sombre.
As locals heard of the duke’s death they turned up to leave flowers outside the entrance.
One young boy, Oscar, came with his mother to lay flowers. He left a card which read: “Your Majesty, so sorry about hearing about your amazing husband.”
“It’s really sad,” another woman told us. “I just wanted him to get to 100,” she said.
The flag here hasn’t been lowered to half-mast. That’s because it’s the Royal Standard which means the Queen is in residence. It’s the one flag which remains at full mast.
It was here that the duke spent his last weeks after being discharged from hospital.
Inside the castle the Queen, now a widow, is in mourning for her husband who has always been by her side.
Prince Philip’s funeral will take place at St George’s Chapel, Windsor – but the arrangements have been amended in light of the coronavirus pandemic, the College of Arms said in a statement.
It added that the funeral will not be a state funeral, and the duke will not lie in state.
The duke will, however, lie at rest in Windsor Castle ahead of a funeral, the College of Arms said, “in line with custom and with His Royal Highness’s wishes”.
The statement said: “The funeral arrangements have been revised in view of the prevailing circumstances arising from the Covid-19 pandemic and it is regretfully requested that members of the public do not attempt to attend or participate in any of the events that make up the funeral.”
Buckingham Palace will confirm the detailed arrangements for the funeral on the Royal website, it added.
All UK government buildings have been told to fly an official flags at half-mast in tribute to the duke until 08:00 BST on the day after the funeral.
Prince Philip and the Queen had four children, eight grandchildren and 10 great-grandchildren.
Their first son, the Prince of Wales, Prince Charles, was born in 1948, followed by his sister, the Princess Royal, Princess Anne, in 1950, the Duke of York, Prince Andrew, in 1960 and the Earl of Wessex, Prince Edward, in 1964.
Prince Philip was born on the Greek island of Corfu on 10 June 1921.
His father was Prince Andrew of Greece and Denmark, a younger son of King George I of the Hellenes.
His mother, Princess Alice, was a daughter of Prince Louis of Battenberg and a great-granddaughter of Queen Victoria.
Politicians across the UK were united in mourning following the announcement of the duke’s death.
Labour leader Sir Keir Starmer said the UK had “lost an extraordinary public servant”, while Scotland’s First Minister Nicola Sturgeon said his “long contribution to public life in Scotland will leave a profound mark on its people”.
Wales’ First Minister Mark Drakeford said the duke “served the crown with selfless devotion and generosity of spirit”.
Parliament will honour the duke on Monday, with the House of Commons sitting at 14:30 BST for tributes following his death.
Parties have also suspended their campaigning elections on 6 May, which will see voters head to the polls for council and mayoral positions in England, the Scottish Parliament and Welsh Parliament.
Meanwhile, Commonwealth leaders led international reaction to the duke’s death.
Australian prime minister Scott Morrison tweeted that the duke “embodied a generation that we will never see again”, while Canada’s prime minister Justin Trudeau described Philip as a “man of great purpose and conviction”.
And Indian prime minister Narendra Modi recalled the duke for his “distinguished career in the military” and work “at the forefront of many community service initiatives”.
The palace said further announcements would be made “in due course”.