Prince Philip, the former naval officer destined to play a sometimes stumbling but steadfast supporting role as the husband of Britain’s Queen Elizabeth II, died April 9. He was 99.

The death at Windsor Castle was announced by the royal family. He had recently been hospitalized while undergoing treatment for an infection and recovering after heart surgery.

When Prince Philip hit the world stage after World War II as then-Princess Elizabeth’s dashing suitor, he was seen as a tall, blond, athletic Viking who would breathe life into the fusty institution of the British monarchy.

They were married in 1947, and with Elizabeth’s coronation in 1953, the couple came to embody a way forward for a shrinking world power experiencing postwar privation and the dismantling of its global empire. The attractive young queen and her husband were regarded as glittering celebrities in the postwar age.

Prince Philip was born into the Greek royal family, and he traced his ancestry to the royalty of Denmark, ­Germany, Russia and Britain. He and Elizabeth were cousins, two great-great-grandchildren of Queen Victoria.

As royal consort, Prince Philip had been at his wife’s side — actually, two paces behind in public, as required by protocol — since she became the queen upon her father’s death in 1952. At her coronation at Westminster Abbey the next year, Prince Philip knelt before the sitting queen and pledged to be her “liegeman,” or faithful servant, for life. This he was, in joint appearances with the queen and, more often, in a continual round of his own official duties until retiring from public life in 2017.

He was an active outdoorsman, hunter, equestrian, aviator and sailor, and he championed causes and institutions close to his heart, including a public service and fitness program for youth, global wildlife conservation and various sporting organizations.

After a long career in the public eye, Prince Philip was respected but not wildly popular among Britons, who came to rely on him to put his foot in his mouth on occasion. This image was nourished by the British press he came to loathe.

To the Paraguayan despot Alfredo Stroessner in 1963: “It’s a pleasure to be in a country that isn’t ruled by its people.” While touring China in 1986, he described parts of Beijing as “ghastly” and joked with a British student that he would end up “slitty-eyed” if he stayed too long. He later said he had been misquoted and had actually said “slit-eyed.”

Over the years, his unfiltered remarks and attempts at humor became legendary for their bad taste. “I thought it was against the law these days for a woman to solicit,” he once said to a female solicitor in a reception line. To a blind woman with a guide dog, he remarked, “Do you know they have eating dogs for the anorexic now?”

During a visit to Scotland in 1995, he asked a driving instructor: “How do you keep the natives off the booze long enough to pass the test?” Age did not make him more decorous. At 90, he asked a disabled man in an electric wheelchair, “How many people have you knocked over this morning on that thing?”

His image as a contrarian was reinforced in 2019, when at age 97 he crashed his SUV into a vehicle carrying three people, including a 9-month-old boy. The prince agreed to surrender his driving license but not before being seen two days after the accident driving, without a seat belt, in a replacement SUV.

Prince Philip made little effort to hide his disdain for tabloid journalists, whom he accused of ruining his life and turning the increasingly turbulent lives of the British royal family into a soap opera.

Biographers paint a much more complex version of Prince Philip. They described him as an alpha male, brusque, sometimes rude — even to the queen — but one who worked hard to support her and give a modern gloss to the 1,000-year-old institution of the English monarchy. In addition to streamlining the daily workings of Buckingham Palace, he became a prominent voice for British industry and technology.

Constrained by a public role that kept him out of politics and in his wife’s shadow, he privately took a less fettered stance as a husband, father and father-in-law. He was furious when he suspected that Princess Diana, while still married to his son Prince Charles, was cooperating on a book that disparaged the royals, but he also wrote her direct but kindly letters that sought to comfort her during her breakup with Charles (they separated in 1992 and divorced in 1996). In one, he wrote, “I cannot imagine anyone in their right mind leaving you for Camilla,” referring to Camilla Parker Bowles, who was to become Charles’s wife and the Duchess of Cornwall.

Prince Philip misread the public antipathy to the royal family in the days after Diana’s death in a car crash in 1997. He agreed with the queen that they should remain at Balmoral Castle in Scotland to shield Diana and Charles’s children — Prince William, then 15, and Prince Harry, 12 — from the media-fed public outpouring of grief and anger in London. But when they returned for Diana’s funeral, it was Prince Philip’s gentle persuasion that convinced the young princes to walk behind their mother’s hearse at St. James’s Palace. “If you don’t walk,” he told William, “you may regret it later. If I walk, will you walk with me?”

Lord Brabourne, who married Prince Philip’s cousin, told royal biographer Gyles Brandreth that “Philip is not sentimental but he is sensitive, profoundly so.”

Just as Prince Philip was preparing to remove himself from public life, the Netflix series “The Crown” came along to shine its light on the bumps in his early married life. The caged alpha male was rumored to have had a few dalliances. Although never substantiated, the reports provided the basis for “The Crown” episodes that played up liaisons, including one with the (real) Russian ballerina Galina Ulanova.

“Have you ever stopped to think that for the last 40 years, I have never moved anywhere without a policeman accompanying me?” he told the Independent in 1992. “So how the hell could I get away with anything like that?”

A 'tough, hard' commander

Philip Schleswig-Holstein-Sonderburg-Glücksburg was born June 10, 1921, on the dining room table — deemed the most manageable location by the doctor — of his parents’ home on the Greek island of Corfu.

Within a year of his birth, the family was whisked out of Greece as his father, Prince Andrea, or Andrew, was about to be executed for a bungled military campaign against Turkey. (The Greek royal family, descended from royal households in northern Europe, was invited to Greece in the 19th century.)

Philip grew up as a displaced child in what would become a broken home. The family lived in Paris for most of the 1920s, but Philip was sent to a boarding school in England when he was 8. Soon after, his mother, Princess Alice, was committed to a mental hospital in Switzerland, and his father left her to live in the South of France. Within a year, Philip’s four older sisters had all married German noblemen.

When he was 12, Philip moved to a novel boarding school in Germany, Schloss Salem, set up by his sister’s father-in-law and an eccentric but brilliant educationist named Kurt Hahn. Hahn, who was Jewish, fled to Britain after an arrest by the Nazis, and then established on the northeast coast of Scotland a similar boys’ school with an emphasis on building character.

The school, Gordonstoun, became noted for the physical hardships visited on its boys, which included early-morning cold showers. Philip arrived at the school in 1934 and took to it like a duck to water, literally. He learned to sail in the cold, stormy waters of the nearby bay.

“I was wet, cold, miserable, probably sick and often scared stiff,” he told Brandreth, “but I would not have missed the experience for anything.”

Two of his brothers-in-law became proud Nazis, and when Philip returned to Germany in 1937 for his sister Cecile’s funeral — she was killed in a plane crash — the cortege included a contingent of high-ranking Nazis in full regalia. A few years later, as a young lieutenant in the Royal Navy, Philip saw action against Italian and German forces and left little doubt about his wartime allegiances.

In 1938, with war looming, he went to Britain’s naval academy in Dartmouth, on the south coast of England, to follow a family tradition of naval service. Both his uncle, Louis “Dickie” Mountbatten, and grandfather before him rose to the highest ranks of the Royal Navy. Mountbatten served as the supreme allied commander in Southeast Asia during World War II and became the last viceroy of India before independence.

When Philip became a British citizen, in 1947, he took Mountbatten as his surname.

During a visit to the naval college by the royal family, less than two months before the outbreak of World War II, Philip, then 18, entertained Princess Elizabeth, who was just 13 and was soon smitten by the lissome, blue-eyed cadet.

As Philip served in the British navy during the war, he and Elizabeth corresponded and met several times. His highly ambitious uncle sought a role as matchmaker, but Philip said he didn’t consider marriage until 1946.

At the couple’s wedding a year later, Philip was created Duke of Edinburgh and granted other titles. When he became a British citizen, he lost his Greek title, but he was named a prince again, this time of the United Kingdom, by his wife 10 years later.

Philip loved the order of naval life, and in 1950, when he was given command of his first frigate, the Magpie, he was determined to run a tight ship. Tim Heald, another biographer, said Philip’s command “was a success. He was tough, hard, mucked in with everybody, and if he had a fault it was a tendency to intolerance.”

Although he had married the heir to the British throne, he had expected his father-in-law, King George VI, to live for an additional 20 years or more, and he looked forward to a long naval career. But the king became terminally ill, and even before his death in 1952, Philip had to give up his ship for what would become a life as the queen’s consort. In time, he served as a leader or member of more than 780 organizations, including the World Wildlife Fund.

In a 1992 interview with the Independent, he still bristled at the thought of having given up his military career. “It was not my ambition to be president of the Mint Advisory Committee. I didn’t want to be president of WWF. I was asked to do it,” he said. “I’d much rather have stayed in the Navy, frankly.”

He spent decades promoting British industry, and on his tours of factories and plants, he would question the way a place was run. This argumentative stance became a hallmark of his public persona. Heald accompanied him on a tour of a distillery near Glasgow during which the prince was told that the juniper berries for making gin were imported.

“But good heavens,” he exclaimed, “there are juniper bushes all over Scotland. Why on Earth do you need to import them?”

Paternal pragmatist

Although Prince Philip passed on many interests to his eldest son, Prince Charles — polo, painting, architectural preservation, Jungian theories, even theology — the two had different personalities and a difficult relationship. “He’s a romantic,” Prince Philip told Brandreth, “and I’m a pragmatist.”

In her book “The Diana Chronicles,” journalist Tina Brown wrote of the time that Prince Philip sent his son a letter to tell him to make up his mind about marrying Diana. Philip had grown cranky over the press frenzy surrounding the romance.

Brown and other biographers have said Prince Philip was simply trying to get his son to make a decision for the sake of Diana’s reputation, but Charles read it as a stern directive to marry — with historically disastrous consequences.

“Any missive from Philip made Charles overreact,” Brown writes. “He carried the letter around in his pocket to show to family and friends as proof of his father’s intolerable bullying.”

Besides the queen, survivors include four children, Prince Charles, Princess Anne, Prince Andrew and Prince Edward; eight grandchildren; and 10 great-grandchildren.

If a personal library is revealing of the owner’s character and interests, Heald’s account of Prince Philip’s is particularly illuminating. By 1990, it had grown to more than 8,000 volumes. He had 560 books on birds, 456 on religion, 373 on horses and 352 on the navy and ships.

“All is well ordered, disciplined, catalogued efficiency. These are the books of a man who might want to look something up in a hurry,” Heald writes.

Between the prince and the queen, the image persisted of what the London Independent once described as “mutually comfortable routine.” They had separate bedrooms for the most part. He showed little tolerance for her passions — Welsh corgis and horse racing — and she let him pursue his hobbies alone. He was often on tour abroad, while she attended to duties close to home.

A friend of Philip’s, the artist Hugh Casson, once described the prince’s paintings as “absolutely totally direct, no hanging about. Strong colours, vigorous brushstrokes.”