3096223
FILE - In this Thursday June, 16, 2011 file photo Britain's Queen Elizabeth II with Prince Philip arrive by horse drawn carriage in the parade ring on the third day, traditionally known as Ladies Day, of the Royal Ascot horse race meeting at Ascot, England. (AP Photo/Alastair Grant, File)

LONDON (AP) — Prince Philip, the irascible and tough-minded husband of Queen Elizabeth II who spent more than seven decades supporting his wife in a role that both defined and constricted his life, has died, Buckingham Palace said Friday. He was 99.

His life spanned nearly a century of European history, starting with his birth as a member of the Greek royal family and ending as Britain’s longest serving consort during a turbulent reign in which the thousand-year-old monarchy was forced to reinvent itself for the 21st century.

He was known for his occasionally racist and sexist remarks — and for gamely fulfilling more than 20,000 royal engagements to boost British interests at home and abroad. He headed hundreds of charities, founded programmes that helped British schoolchildren participate in challenging outdoor adventures, and played a prominent part in raising his four children, including his eldest son, Prince Charles, the heir to the throne.

Philip spent a month in hospital earlier this year before being released on March 16 to return to Windsor Castle.

“It is with deep sorrow that Her Majesty The Queen has announced the death of her beloved husband, His Royal Highness The Prince Philip, Duke of Edinburgh,” the palace said. “His Royal Highness passed away peacefully this morning at Windsor Castle.”

Philip, who was given the title Duke of Edinburgh on his wedding day, saw his sole role as providing support for his wife, who began her reign as Britain retreated from empire and steered the monarchy through decades of declining social deference and UK power into a modern world where people demand intimacy from their icons.

In the 1970s, Michael Parker, an old navy friend and former private secretary of the prince, said of him: “He told me the first day he offered me my job, that his job — first, second and last — was never to let her down.”

The queen, a very private person not given to extravagant displays of affection, once called him “her rock” in public.

In private, Philip called his wife Lilibet; but he referred to her in conversation with others as “The Queen.”

Over the decades, Philip’s image changed from that of handsome, dashing athlete to arrogant and insensitive curmudgeon. In his later years, the image finally settled into that of droll and philosophical observer of the times, an elderly, craggy-faced man who maintained his military bearing despite ailments.

The popular Netflix series “The Crown” gave Philip a central role, with a slightly racy, swashbuckling image. He never commented on it in public, but the portrayal struck a chord with many Britons, including younger viewers who had only known him as an elderly man.

Born June 10, 1921, on the dining room table at his parents’ home on the Greek island of Corfu, Philip was the fifth child and only son of Prince Andrew, younger brother of the king of Greece. His grandfather had come from Denmark during the 1860s to be adopted by Greece as the country’s monarch.

Philip’s mother was Princess Alice of Battenberg, a descendent of German princes. Like his future wife, Elizabeth, Philip was also a great-grandchild of Queen Victoria.

When Philip was 18 months old, his parents fled to France. His father, an army commander, had been tried after a devastating military defeat by the Turks. After British intervention, the Greek junta agreed not to sentence Andrew to death if he left the country.

The family was not exactly poor but, Philip said: “We weren’t well off” — and they got by with help from relatives. He later brought only his navy pay to a marriage with one of the world’s richest women.

Philip’s parents drifted apart when he was a child, and Andrew died in Monte Carlo in 1944. Alice founded a religious order that did not succeed and spent her old age at Buckingham Palace. A reclusive figure, often dressed in a nun’s habit, she was little seen by the British public. She died in 1969 and was posthumously honored by Britain and Israel for sheltering a Jewish family in Nazi-occupied Athens during the war.

Philip went to school in Britain and entered Britannia Royal Naval College Dartmouth as a cadet in 1939. He got his first posting in 1940 but was not allowed near the main war zone because he was a foreign prince of a neutral nation. When the Italian invasion of Greece ended that neutrality, he joined the war, serving on battleships in the Indian Ocean, the Mediterranean and the Pacific.

On leave in Britain, he visited his royal cousins, and, by the end of war, it was clear he was courting Princess Elizabeth, eldest child and heir of King George VI. Their engagement was announced July 10, 1947, and they were married on Nov. 20.

After an initial flurry of disapproval that Elizabeth was marrying a foreigner, Philip’s athletic skills, good looks and straight talk lent a distinct glamour to the royal family.

Philip is survived by the queen and their four children — Prince Charles, Princess Anne, Prince Andrew and Prince Edward — as well as eight grandchildren and nine great-grandchildren.

The grandchildren are Charles’ sons, Prince William and Prince Harry; Anne’s children, Peter and Zara Phillips; Andrew’s daughters, Princess Beatrice and Princess Eugenie; and Edward’s children, Lady Louise and Viscount Severn.

The great-grandchildren are William and Kate’s children, Prince George, Princess Charlotte and Prince Louis; Harry and Meghan’s son, Archie; Savannah and Isla, the daughters of Peter Phillips and his wife, Autumn; Mia and Lena, the daughters of Zara Phillips and her husband, Mike Tindall; and Eugenie’s son, August, with her husband, Jack Brooksbank.