His lifelong role was to ensure that he never let her down and their long-lasting marriage was arguably one of the world's best-known relationships.
Although he was not officially given the title of Prince Consort, Philip - a private, enigmatic man of strong character - was always there, one step behind, ready to lend the Queen a helping hand.
Through his stewardship, he had a profound effect on the development of the British monarchy.
In public, the duke never attempted to upstage the woman he loved. In private, it was Philip that the Queen would defer to.
At home, he assumed the position of head of the family as the royal patriarch.
The duke became the longest-serving consort in British history and the oldest serving partner of a reigning monarch, while his wife became Britain's longest-reigning monarch and the world's longest-reigning still-serving monarch.
Like his great-great-grandfather Prince Albert, Queen Victoria's beloved husband, Philip immersed himself in national life, yet managed to retain something of the sceptical spectator.
Some thought he was arrogant, rude and insensitive; others found him witty and fun.
He could be abrupt, outspoken and was not afraid of using colourful language. He was parodied for his bad-tempered outbursts and criticised for his famous gaffes.
Philip once warned a group of Scottish students in China that they would become "slitty-eyed".
On another occasion, he pointed to a fusebox of loose wires in a Glasgow factory and remarked that it looked like it had been installed by an "Indian".
He was well aware of his public image, once telling former Tory MP Gyles Brandreth: "I have become a caricature. There we are. I've just got to accept it."
Philip was a forceful man, often portrayed as short-tempered and rather off-hand in his manner.
Yet he had the ability to charm and could be relied upon to break the ice with his sense of humour and quick repartee.
The curious duke would ask endless questions while on engagements, grilling and challenging his hosts persistently.
He had the no-fuss, no-nonsense manner so often associated with his daughter, the Princess Royal.
He was once said to have described himself as "a discredited Balkan prince of no particular merit or distinction".
Philip often received little public acclaim for his tireless charity work and support for the monarchy in difficult times.
He and the Queen witnessed the failure of three of their four children's marriages and the fallout that followed, particularly the scandal surrounding Camilla Parker Bowles, who eventually married into The Firm.
The royal family also faced criticism for their response to the death of Diana, Princess of Wales.
The duke was depicted as a tough, but caring father, amid speculation that his relationship with the Prince of Wales was not always the easiest.
But he guarded his privacy and refused to discuss such matters.
By almost any standard he was a remarkable character. He had all the qualities which, even without his royal status, would have led him to the top.
He was a successful naval officer - there are those who believe that, had the duke not married Princess Elizabeth, he would have been First Sea Lord - and he was also an experienced pilot.
In his leisure moments he was a good shot, a first-class polo player, an accomplished sailor, enthusiastic cricketer and international four-in-hand carriage driver.
His themes were many but he regularly returned to the prickly subject of the British economy and also conservation, one of his great passions.
He could speak with authority on industry, science and nature.
One of the duke's most famous speeches was in 1961 when he told industrialists: "Gentlemen, I think it is time we pulled our fingers out."
He often criticised exporters for not fighting hard enough for Britain abroad and hit out at the "I'm all right, Jack" society for not pulling its weight at home.
Even in later life, Philip was a modern man. He was always forward-thinking and often ahead of his time.
He was eating muesli 20 years before most people and drove around London in an electric car in an attempt to fight pollution.
Born at the family home, Mon Repos - allegedly on the kitchen table - on the Greek island of Corfu on June 10 1921, he was brought to Britain when he was just a year old.
Evacuated in a British warship, the blond, blue-eyed prince was carried into exile in a makeshift cot made from an old orange box.
Although he was a Prince of Greece and Denmark, he had no Greek blood. His complex background was in fact Danish, German, Russian and British.
He was the youngest child and only son of Prince Andrew of Greece, an officer in the Greek Army, and Princess Alice of Battenberg.
His father was descended from kings of Denmark and Prussia, as well as emperors of Russia.
His maternal grandmother, Princess Victoria of Hesse, was a granddaughter of Queen Victoria, making him Elizabeth II's third cousin.
Philip and the Queen were both great-great-grandchildren of Queen Victoria.
The duke's mother was the sister of Louis Mountbatten, later Earl Mountbatten of Burma.
The family was forced to flee Corfu in December 1922 after Philip's monocle-wearing father, a lieutenant-general in the Greek army, was arrested and charged with high treason in the aftermath of the heavy defeat of the Greeks by the Turks.
It was said he disobeyed orders and abandoned his post with his cavalry regiment in the face of attack.
King George V sent HMS Calypso and a British secret agent to negotiate his release, collect him and his wife, their four daughters and baby Philip and take them into exile.
They finally arrived in Paris, dependent on relatives for financial help.
Philip's childhood from then on was unsettled and somewhat bleak. He was without a permanent home.
Moving between various relatives, the young prince was enrolled in a primary school in Paris before coming to Britain at the age of eight when he attended Cheam School in Surrey from 1930 to 1933.
His parents' relationship broke down and his father was based in Monte Carlo, where he amassed gambling debts. He died there in 1944.
His religious mother, Princess Alice, who was deaf, formed an order of nuns, but began to suffer from depression and was treated in an asylum. She died at Buckingham Palace in 1969.
In 1933, Philip moved to Salem School in Baden, Germany - all four of his sisters married German princes.
The educational institution was set up by Dr Kurt Hahn, a German Jew, as a way of training self-reliant youngsters, focusing on character-building rather than classroom studying.
Dr Hahn was arrested for resisting Nazi ideas, but was freed thanks to British intervention and fled to the UK.
Philip was also back within the year and was enrolled at Gordonstoun, the new boys' school near Elgin, Scotland, started by Dr Hahn, who had a profound influence on the prince.
He very rarely saw his parents and was left isolated, but he was a happy, lively child. He later said of his family's break-up: "I just had to get on with it. You do. One does."
He thrived at Gordonstoun, captaining the hockey and cricket teams and becoming guardian (head boy) in his last term. It was there he learned to "mess about in boats", laying the solid foundation of a future naval career.
His Uncle Dickie, Lord Mountbatten, one of Britain's greatest seamen, took a keen interest in the prince's progress.
After leaving school, Philip joined the Royal Navy, beginning at the Britannia Royal Naval College in Dartmouth in May 1939, and was singled out as best cadet.
During the Second World War, he served on several ships - firstly on HMS Ramillies - and saw active service against German, Italian and Japanese forces.
Early in 1940, the 19-year-old prince was in action as a midshipman.
In March 1941, he was a searchlight control officer on the battleship HMS Valiant and was mentioned in despatches for his part in the battle of Matapan against the Italian fleet.
His commanding officer said: "Thanks to his alertness and appreciation of the situation, we were able to sink in five minutes two 8in gun Italian cruisers."
Shortly afterwards he was awarded the Greek War Cross of Valour.
When he moved up through the ranks to become First Lieutenant in the destroyer HMS Wallace (at the age of 21), he was the youngest officer in the service to have an executive job in a ship of its size.
He was present at the Japanese surrender in Tokyo Bay in 1945.
Home leaves brought invitations from King George VI to stay at Windsor Castle.
It was in this romantic setting that the dashing naval officer resumed his friendship with the young Princess Elizabeth.
They had been present together on various occasions, including the wedding in 1934 of Philip's cousin, Princess Marina, later Duchess of Kent, to Princess Elizabeth's uncle,
Prince George, Duke of Kent, and at the coronation of George VI in 1937.
But it was at Dartmouth in July 1939, when King George VI and Queen Elizabeth visited the naval college with their two daughters, that Philip, then 18, and the 13-year-old Elizabeth had their first publicised meeting.
Good-looking and blond-haired, the tall, athletic prince impressed Lilibet by jumping over the college tennis nets.
From that time they maintained a regular correspondence and met on several occasions.
Philip was invited to spend Christmas 1943 with the royal family at Windsor and, by the end of the war, newspapers were speculating about their relationship.
There was, however, some disapproval and suspicion of this foreign prince in the post-war years.
Old-school courtiers were concerned that he was not a traditional English gentleman, even though he had fought for Britain in the Navy.
But Philip and Elizabeth were already in love. It has been suggested that they became unofficially engaged in the summer of 1946 while they were staying at Balmoral, but the official announcement was delayed until after the princess reached 21 and returned from a royal tour of South Africa.
Philip applied for British nationality and in February 1947 became a naturalised British subject, renouncing his Greek royal title.
He adopted a new surname, but decided against Schleswig-Holstein-Sonderburg-Glucksburg - the family name of the Danish royal house from which his father was descended.
Instead he settled on Mountbatten, an Anglicised version of Battenberg, his mother's family name.
The style of His Royal Highness was authorised shortly before his marriage on November 20 1947 at Westminster Abbey and he was created Duke of Edinburgh, Earl of Merioneth and Baron Greenwich, and made a Knight of the Garter.
He was accorded by the Queen the style and title of a Prince of the United Kingdom in February 1957.
The wedding, attended by an array of foreign kings and queens, captured the public imagination in the austere post-war days of November 1947. The newlyweds were called the Fairy Princess and Prince Charming.
After honeymooning at Broadlands in Hampshire, home of Lord Mountbatten, and at Birkhall on the Balmoral estate in Scotland, Princess Elizabeth and the Duke of Edinburgh stayed at Buckingham Palace until renovation of their new home, nearby Clarence House, was completed in 1949.
Philip's devotion to his wife was clear. His first ever private secretary Michael Parker, a friend from the Navy, revealed: "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 couple's first child, Charles, was born at Buckingham Palace in November 1948. Anne was born at Clarence House in August 1950. Ten years later, Andrew was born at Buckingham Palace in February 1960, as was Edward in March 1964.
Philip resumed his naval career, attending the Royal Naval Staff College at Greenwich, and in October 1949 was appointed First Lieutenant and second-in-command of HMS Chequers, operating from Malta.
Elizabeth joined him there at several stages between 1949 and 1951 and had an idyllic life on the Mediterranean island, relishing the relative privacy that living abroad offered them.
Promotion to Lieutenant-Commander followed in July 1950 and, in September, Philip was given command of the frigate HMS Magpie, which he said were the happiest days of his sailor life.
He was eventually promoted to Commander in June 1952 and to Admiral of the Fleet in January 1953. His other service appointments were Field Marshal and Marshal of the Royal Air Force.
Because of increasing anxiety about the King's health, the duke was expected to take a share of royal engagements. In July 1951, it was announced that Philip would take up no more active naval appointments.
Princess Elizabeth and Philip made their first major tour together to Canada and the United States in October and November 1951, after which the duke was made a Privy Counsellor.
On February 6 1952, Elizabeth and Philip were on a tour of Kenya at Sagana Lodge after spending the night at the Treetops Hotel when a message was given to Philip that the King was dead.
An aide remarked that he looked as if half the world had fallen in on him.
He broke the news to the new Queen while they were alone. Hours later they were on their way back home.
At the Coronation in Westminster Abbey in June 1953, the duke duly knelt to pay homage to the Queen before kissing her left cheek.
He swore to be her "liege man of life and limb". He had no constitutional role other than as a Privy Counsellor. He saw no state papers and, although he was a member of the House of Lords, he never spoke in the chamber.
On the death of the King, with his naval career at an end, Philip's life changed irrevocably.
He was left disappointed when the Queen declared on her accession that the royal family's surname would be Windsor and not Mountbatten, prompting him to make the well-reported remark: "I'm just a bloody amoeba."
There are claims that his actual protest in fact contained a number of expletives and the assertion that he was only there to provide sperm.
After the Coronation, Philip was required to play a major role both nationally and internationally.
He accompanied the Queen on Commonwealth tours and state visits overseas, as well as on public engagements in all parts of the UK.
He also undertook many royal engagements on his own, at home and abroad. Over the years he was involved with hundreds of organisations and was often a hands-on president.
From the outset he took a keen interest in young people through such organisations as the National Playing Fields Association and the Outward Bound Trust.
In this regard, however, he was best known for the Duke of Edinburgh's Award, which he launched in 1956, inspired by his time at Gordonstoun.
He took a prominent international role in the conservation of nature. He was the first president of the World Wildlife Fund-UK from 1961 to 1982, and in 1981 became the charity's international president.
The duke took a great interest in scientific and technological research and development. He was patron of the Industrial Society and president of the British Association for the Advancement of Science from 1951 to 1953.
He also focused on housing matters and served as president of the National Federation of Housing Associations from 1975 to 1980.
He chaired the Inquiry Into British Housing which in 1991 called for the fundamental reform of housing finance, including the phasing-out of mortgage interest tax relief, in a bid to tackle homelessness and bad living conditions.
He was an accomplished sportsman, playing polo regularly until 1971 and then taking up four-in-hand carriage driving, representing Britain at several European and world championships. He also loved to shoot game.
He was president of the Federation Equestre Internationale, the Central Council of Physical Recreation, the British Amateur Athletics Board, the Commonwealth Games Federation, and of the MCC twice, in 1949 and 1975.
A qualified pilot, he gained his RAF wings in 1953, helicopter wings in 1956 and private pilot's licence in 1959.
His love of the sea never waned and he competed regularly at Cowes Regatta. He was Admiral of the Royal Yacht Squadron, patron of a number of clubs and president of the Royal Yachting Association.
Philip was awarded a number of honorary degrees and fellowships. He was made a Fellow of the Royal Society in 1951, was Chancellor of Cambridge and Edinburgh Universities, and a Life Governor of King's College, London.
He was given the task by his wife of reorganising her Balmoral and Sandringham estates, which he did with ruthless efficiency.
He set about modernising Buckingham Palace after being told to keep out of the Queen's official duties when she acceded to the throne.
"I tried to find useful things to do," he said of starting a footman training programme at the Palace.
He was also fundamental in the upkeep of Windsor Castle, from designing gardens to introducing deer, and was followed by the BBC for a behind-the-scenes documentary in 2005 charting his role as ranger of the vast parkland.
Much was written about Philip's relationships with his former daughters-in-law, Diana, Princess of Wales, and Sarah, Duchess of York.
It was the duke who wrote to Charles telling him to make up his mind when the prince, amid a great deal of public interest, was dragging his heels on whether to ask Lady Diana Spencer to marry him.
When the marriage was falling apart, the duke wrote to the princess several times.
It was claimed that he had called her a "trollop" and a "harlot" in correspondence, but Buckingham Palace took the rare step of denouncing the allegations as false.
It was revealed that the letters were signed "With love from Pa".
When Diana died suddenly in a car crash in Paris in 1997, Philip joined Charles, Princes William and Harry and the Princess's brother, Earl Spencer, in the solemn procession behind her funeral cortege.
There were said to have been tensions with the Duke of York's former wife, Sarah, whose behaviour Philip described once as "a bit odd".
The duke had a loyal staff, despite his legendary displays of temper. Many stayed with him for years, showing great devotion and describing him as the least boring man they had ever met.
American biographer Kitty Kelley admitted having difficulty "digging dirt" on him, such was the support of his friends.
Throughout his life, there were unsubstantiated stories about Philip's friendships with glamorous women.
His carriage-driving partner Lady Penny Romsey, actress Pat Kirkwood, performer Helene Cordet, film star Merle Oberon, Sacha Abercorn, actress Anna Massey and Princess Alexandra were just some of the women about whom there was speculation.
But the claims were never proven and those close to the duke insisted they were untrue.
Ms Abercorn said they simply shared an interest in Jung's philosophy.
"It was a passionate friendship, but the passion was in the ideas. It was certainly not a full relationship. I did not go to bed with him." she once said.
The duke's former private secretary, Mike Parker, said Philip had been 100% faithful to the Queen, while Lord Charteris, formerly the Queen's private secretary, said there was no evidence of any kind that he had strayed.
Gyles Brandreth, who examined the duke and the Queen's relationship in his book, concluded that the female friends were merely playmates, not mistresses.
The duke globetrotted and fulfilled countless engagements well into his 80s and 90s.
A busy and demanding schedule did take its toll sometimes. While accompanying the Queen on a state visit to South Korea in April 1999, he fell asleep at a banquet.
In 2007, the year he turned 86, he undertook more than 354 engagements with the Queen and on his own at home and abroad, while in 2013 when he turned 92 and took time off after an operation, he still carried out 184 engagements in the UK and overseas.
He enjoyed good health throughout much of his life but in April 2008 he was admitted to hospital with a chest infection which forced him to cancel a number of engagements.
He spent three nights in the private King Edward VII's Hospital in central London but went on to make a full recovery.
In his later years Philip's energy appeared undimmed, although his brusqueness was said to have mellowed with age.
He was fit and active and continued to enjoy fast-paced, dangerous carriage driving events, competing at international level until he was 85. But he still took part non-competitively well beyond this age.
He would hare round the courses at high speed, gripping the reins, determination etched on his face.
His wife would watch from the sidelines, her camera at the ready, proud, excited and sometimes concerned for his safety.
Philip was always happy to joke about his mortality and could occasionally be heard when reference was made to a future project at official engagements to snort with laughter and make a quip about his limited lifespan.
When he reached his 80th birthday in 2001, he was applauded for his devoted service to the nation and the Commonwealth.
He reflected at the time: "I imagine there are a few fortunate souls who have managed to get through life without any anxieties, but my experience is that life has its ups and downs."
When he turned 90 in June 2011 he insisted on no fuss, but the monarch bestowed on him a new title - Lord High Admiral, titular head of the Royal Navy.
It was the Queen's touching tribute to her husband who had selflessly given up the naval career he loved to support her.
Philip's advancing years were acknowledged by him stepping down as president or patron of more than a dozen organisations ahead of his 90th birthday.
Serious health scares came in 2011 when he was rushed to hospital for a blocked coronary artery, and then, in June 2012, when he missed the majority of the Queen's
Diamond Jubilee celebrations after falling ill with a bladder infection, as he did again two months later.
He was admitted to hospital for an exploratory operation on his abdomen in 2013.
He pulled out of the Battle of Jutland anniversary events in 2016 because of a minor ailment.
But a fortnight later, the 95-year-old duke joined the Queen throughout her busy official 90th birthday festivities, including a service of thanksgiving, Trooping the Colour and a street party on The Mall.
Then in May 2017, Buckingham Palace announced that he was soon to retire from public duties.
Philip, keen to spend more of his time doing things he enjoyed, made the decision himself, and tributes flowed in praise of his decades of royal service and unfailing support of the Queen.
A few months later, in August, at the age of 96, he carried out his final official royal engagement - with appropriate military connections - meeting Royal Marines on the Palace forecourt.
A hip replacement operation in 2018 did not prevent him attending the wedding of the Duke and Duchess of Sussex just weeks later.
His life in retirement hit the headlines in January 2019 when he miraculously escaped unscathed when the car he was driving, at the age of 97, was involved in a serious crash with a vehicle carrying a mother and a baby.
In a perfect example of his stubbornness and defiance, the duke was spotted driving without a seatbelt just 48 hours later.
But he finally brought an end to driving on public roads when he voluntarily surrendered his driving licence in the weeks that followed.
Married to the monarch for more than 70 years, the duke was at the Queen's side when her father died and helped her through the deaths of both her mother and sister in the Golden Jubilee year of 2002.
He was there too when the Queen made history by becoming the nation's longest-reigning monarch in 2015 - no doubt sharing her matter-of-fact view that such milestones were simply part of living a long life.
They reached their platinum wedding anniversary in November 2017 - a first for a British monarch - and the poignant personal landmark was celebrated with a black-tie party for friends and family at Windsor Castle.
Amid the coronavirus pandemic, the Queen and the duke spent lockdown together at Windsor Castle, separated from their family.
He was admitted to King Edward VII's Hospital on February 16 on a precautionary basis after feeling unwell. On March 3 he underwent heart surgery at St Bartholomew's Hospital for a pre-existing condition.
After spending 28 nights in hospital, the duke was discharged from King Edward's and returned to Windsor Castle.
A source of great strength for his wife, Philip could also be relied on by the public to say something he shouldn't.
Opinionated, contentious, frank and fun, the duke was even said to have coined the word "dontopedalogy" - the art of putting one's foot in one's mouth.
Yet he too was a symbol of continuity - albeit a more outspoken one than the Queen - during the monarchy's, and the country's, ups and downs.
The Queen, in a speech to celebrate their golden wedding anniversary in 1997, paid a moving tribute.
"He is someone who doesn't take easily to compliments," she said.
"But he has, quite simply, been my strength and stay all these years, and I, and his whole family, and this and many other countries, owe him a debt greater than he would ever claim, or we shall ever know."