Queen Elizabeth II's husband Prince Philip, who recently spent more than a month in hospital and underwent a heart procedure, died on Friday, Buckingham Palace announced. He was 99.
"It is with deep sorrow that Her Majesty The Queen announces the death of her beloved husband, His Royal Highness The Prince Philip, Duke of Edinburgh," it said in a statement.
"His Royal Highness passed away peacefully this morning at Windsor Castle.
"The Royal Family join with people around the world in mourning his loss."
The palace added that further announcements would be made "in due course".
Fears over the health of the Duke of Edinburgh, as he was formally known, had been heightened after he recently spent a month in hospital for treatment.
He left hospital on March 16 following what was described as a successful procedure for a pre-existing condition and treatment for an unspecified infection.
He was first admitted on February 16 on the advice of his doctor after he complained of feeling unwell.
Philip had returned to Windsor Castle, west of London, where he had been isolating with the queen - Britain's longest-serving monarch - since the start of the coronavirus pandemic last year.
He was due to turn 100 in June.
The news of his death saw television channels interrupt regular programmes and start special coverage marking his life.
The BBC announced his death and played the national anthem, "God Save the Queen".
Philip had increasingly struggled with his health in recent years, and had retired from public life.
In the run-up to Christmas 2011, Philip was taken to hospital by helicopter after suffering chest pains.
The Greek-born former naval officer was then treated for a blocked coronary artery and had a stent fitted.
The strength behind the crown
He often grabbed headlines for his gaffes, but Prince Philip was portrayed by royalists as the silent stalwart, who shelved his personal ambitions to support Queen Elizabeth II over seven decades.
Born into the Greek royal family - although he preferred to be thought of as a Danish prince - the Duke of Edinburgh never wore a crown himself.
Yet he was a permanent public presence at the queen's side, who called him her "strength and stay".
Like her, his life was ruled by duty and tradition, putting his considerable energy behind numerous charities and carrying out 22,219 solo public engagements since Elizabeth rose to the throne in 1952.
But Philip regularly got into hot water for what were politely referred to as "politically incorrect" off-the-cuff remarks - quips that from anyone else would be seen as downright racist.
"You managed not to get eaten, then?" he remarked to a British student who had trekked in Papua New Guinea in 1998.
And on a historic state visit to China in 1986, the self-described "cantankerous old sod" warned a group of British students: "If you stay here much longer, you'll all be slitty-eyed."
There was also his reputation as a womaniser, something that worried the royal family even before he and queen married.
They reportedly found the young naval officer "rough, ill-mannered and uneducated" and worried he "would probably not be faithful".
The man the queen's formidable mother privately referred to as "The Hun" because of his German Battenberg blood, was quickly suspected of a string of affairs, which would later be resurrected in the hit Netflix series "The Crown".
But Philip laughed off talk of philandering - with Sarah, the Duchess of York's mother often cited as one of his former lovers.
"For the last 40 years I have never moved anywhere without a policeman accompanying me. So how the hell could I get away with anything like that?" he said.
At home, the duke had a reputation for being cold towards his four children, Charles, Anne, Andrew and Edward.
But many observers considered Philip to be the glue that held together the royal family.
And in a rarely seen softer side, it emerged the late princess Diana addressed him as "Dearest Pa" in letters in which he offered solace over her deteriorating marriage to his eldest son Charles.
'Trial and error'
Philip, the world's longest serving consort, was blessed with robust health for much of his long life, and conducted his final official appearance in August 2017 at the age of 96.
But he was admitted to hospital with various complaints as he advanced into his 90s, most recently for a heart procedure.
In January 2019, at the age of 97 and still driving, he was involved in a car accident near the royal estate of Sandringham in eastern England.
His Land Rover Freelander overturned and two other motorists were injured.
Prosecutors decided not to press charges after the prince, who walked away unscathed, voluntarily surrendered his driving licence.
The accident saw him withdraw from public life and he spent much of 2020 in isolation with the queen at their Windsor Castle home west of London, shielding from the coronavirus pandemic.
But he made several appearances, including at the wedding ceremony of his granddaughter Princess Beatrice in July, four months before celebrating his own 73rd wedding anniversary.
He also attended a military ceremony at Windsor in July when he handed over his ceremonial military role as Colonel-in-Chief of The Rifles regiment to his daughter-in-law Camilla, wife of Prince Charles.
Never one to talk about his own feelings, the prince admitted in a rare 2011 interview that he had carved out his own role in the royal family by "trial and error".
Asked if he had been successful, he told the BBC in his typical forthright manner: "I couldn't care less. Who cares what I think about it? I mean it's ridiculous."
But the queen has been more forthcoming about his worth.
"He has, quite simply, been my strength and stay all these years," she said in a speech to mark their golden wedding anniversary in 1997.
Exile from Greece
Prince Philippos of Greece and Denmark was born on a kitchen table on Corfu on June 10, 1921, the only son of prince Andrew of Greece - the younger brother of Greece's king Constantine - and princess Alice of Battenberg.
Aged just 18 months, he and his family were evacuated in a British Royal Navy ship from politically unstable Greece, with the toddler reputedly carried in a cot made from an orange box.
The family settled in Paris with young Philip heading to the austere Gordonstoun public school in Aberdeenshire, northeast Scotland, where he became head boy.
He pursued his love of sailing and at the outbreak of World War II in 1939 became an outstanding Royal Navy cadet before serving on battleships in the Indian Ocean and the Mediterranean.
As the war progressed, Philip was mentioned in despatches and promoted through the ranks.
By 1945, he was a first lieutenant and witnessed the Japanese surrender in Tokyo Bay with the British Pacific Fleet.
Philip had been formally introduced to princess Elizabeth, the future queen, in July 1939.
The pair shared a great-great grandmother - Queen Victoria - making them distant cousins, and they kept in touch during the war, meeting on a number of occasions.
But it was not until July 1947 that their engagement was announced and they tied the knot that year on November 20 at Westminster Abbey in London.
'Duty to serve her'
The royal couple made their first major tour together - to Canada and the United States - in 1951.
By now a commander, Philip's naval career was cut short by the death of Elizabeth's father, king George VI, in 1952, which brought her to the throne.
"Prince Philip was a highly talented seaman," said his contemporary Terence Lewin. "If he hadn't become what he did, he would have been First Sea Lord (chief of naval staff) and not me."
Philip once admitted the curtailment of his career was "disappointing" but said, "being married to the queen, it seemed to me that my first duty was to serve her in the best way I could".
Yet he remained closely involved with the armed services and the queen marked his 90th birthday in 2011 by appointing him Lord High Admiral - the titular head of the British Royal Navy and an office until then held by her.
He was a keen flyer, clocking well over 5,000 hours of pilot time, and turned his love of horses to competition, first as a polo player and later representing Britain at carriage-driving.
He also maintained an interest in science, technology and the environment and for years drove a liquid petroleum gas taxi around London.
His greatest legacy may lie in the Duke of Edinburgh's Award scheme, which was set up in 1956 to develop the confidence and skills of young people aged 15 to 25 in Britain and the Commonwealth.
His youngest son, Edward, said its importance was likely to be greater due to the effects of the coronavirus pandemic on formal education.
"I think the role of the non-formal in this present climate is going to be even more important than ever before because it's those skills and experiences which are going to be looked for," he told Sky News television.
Philip was also patron of a number of organisations, including the World Wide Fund for Nature, and chancellor of the universities of Cambridge and Edinburgh.