LONDON — Prime Minister Boris Johnson was hospitalized on Sunday evening after 10 days of battling the coronavirus, unnerving a country that had gathered to watch Queen Elizabeth II rally fellow Britons to confront the pandemic and reassure them that when the crisis finally ebbed, “we will meet again.”
The British government said that Mr. Johnson would be undergoing tests and that he would continue to carry out his duties.
But the uncertainty generated by his persistent illness underscored the sense of crisis that led the queen to address the country in a rare televised speech that evoked the darkest days of World War II.
“I am speaking to you at what I know is an increasingly challenging time,” the queen said. “A disruption that has brought grief to some, financial difficulties to many, and enormous changes to the daily lives of us all.”
Her remarks were taped at Windsor Castle, where she has sequestered herself against a virus that has infected at least 40,000 people in Britain, including her eldest son and heir, Prince Charles, and other senior British officials besides Mr. Johnson.
Speaking in terms both personal and historical, the queen likened the enforced separation of Britain’s lockdown to the sacrifices families made during World War II, when parents sent away their children for their own safety. She urged a country that has approached these measures with some nonchalance to commit itself to the cause.
“Today, once again, many will feel a painful sense of separation from their loved ones,” the queen said. “But now, as then, we know, deep down, that it is the right thing to do.”
Before being transferred to the hospital, Mr. Johnson had been in isolation in his flat next door to 10 Downing Street, where officials said he was running a high temperature. Early last week, Mr. Johnson’s aides said they expected him to end his self-isolation on Friday. But he still looked visibly weakened when he made a statement in a video late in the week.
“On the advice of his doctor, the prime minister has tonight been admitted to hospital for tests,” a spokesman said Sunday. “This is a precautionary step, as the prime minister continues to have persistent symptoms of coronavirus 10 days after testing positive for the virus.”
The British foreign secretary, Dominic Raab, is expected to lead the daily cabinet meeting on the pandemic on Monday. Under the government’s succession plan, Mr. Raab would take up Mr. Johnson’s duties if he is incapacitated.
The queen’s speech was only the fourth time in her 68-year reign in which she has addressed the British people, apart from her annual Christmas greeting — and it carried a distinct echo of the celebrated radio address her father, George VI, delivered in September 1939, as Britain stood on the brink of war with Germany.
Like the king eight decades ago, the queen appealed to the quintessential British traits of stoicism and solidarity, and explicitly linked the pandemic to the war as a defining moment for modern Britain. This time, she said, the country needs to come together to vanquish an enemy that brings death not in the terrifying bombing raids of the Blitz but in the ordinary encounters of people transmitting a dangerous pathogen.
“I hope in the years to come, everyone will be able to take pride in how they responded to this challenge,” the queen said, “and those who come after us will say that the Britons of this generation were as strong as any. That the attributes of self-discipline, of quiet good-humored resolve and of fellow-feeling still characterize this country.”
Buckingham Palace took extraordinary measures to protect the queen, who turns 94 this month, from infection. She recorded the speech in a large room with only a single camera operator, according to a palace official. The operator wore a mask and gloves while a skeleton crew monitored from another room.
Fears for the queen’s health grew after Prince Charles announced two weeks ago that he was suffering mild symptoms of the virus. He had met his mother on March 12, only a day before his medical advisers assessed that he might have been infectious.
After isolating himself for seven days at Birkhall, his residence in Scotland, Charles re-emerged, via a video link from Scotland, to dedicate a new field hospital for coronavirus patients that was constructed in less than two weeks in a cavernous convention center in London’s Docklands.
On Saturday, Mr. Johnson’s 32-year-old girlfriend, Carrie Symonds, disclosed that she, too, is suffering symptoms. Ms. Symonds is pregnant; the couple announced last month that they were engaged.
Other senior officials, including the health secretary, Matt Hancock, and the chief medical officer, Chris Whitty, have also had to isolate themselves because of symptoms.
With 41,903 confirmed cases, and 4,313 deaths, Britain appears to be following the same grim trajectory as other European countries. The British government, however, came late to the need for social distancing, with Mr. Johnson initially balking at ordering pubs and restaurants to close.
He is now an ardent convert and recorded a video from his quarantine urging people — without much success — not to flock to London parks during a sun-kissed spring weekend.
Britain’s response to the pandemic has improved since that shaky start.
The government has vowed to conduct 100,000 virus tests a week by the end of April, a tenfold increase over the current rate. And worries that the National Health Service would be overwhelmed by the surge of patients have subsided somewhat.
The queen herself has expressed no qualms about cutting social contacts.
She canceled her public schedule and left Buckingham Palace on March 19, four days before Mr. Johnson ordered a lockdown across the country. Her 98-year-old husband, Prince Philip, was flown to Windsor Castle by helicopter from his residence on the grounds of Sandringham, another of the queen’s residences.
After Prince Charles announced his illness, Buckingham Palace said the queen was healthy, and it has not issued any updates on her condition.
But in her appearance on Sunday, seated next to a writing desk with a flowering plant, she looked alert and at ease. The palace did not comment on a recent report in a British tabloid, The Sun, that one of the queen’s footmen, who walks her dogs, had contracted the virus.
Although the royal family has endured a litany of bad news in the last year — from the bitter departure of Prince Harry and his wife, Meghan, to the messy dealings of Prince Andrew with the disgraced financier and convicted sexual predator, Jeffrey Epstein — the queen remains a revered figure among many Britons.
She has used her lofty stature sparingly outside of her official schedule of investitures, diplomatic receptions and regular meetings with the prime minister (she and Mr. Johnson conducted their most recent one by phone).
Her speech included familiar touches, like an expression of thanks to the doctors and nurses of the National Health Service, something she has done in countless statements after natural disasters. She noted that at 8 p.m. every Thursday, people gather at their windows or doorways to applaud the health workers.
By custom, the queen addresses the nation on Christmas Day. The only other times that she has given a televised address were in 1991 during the Persian Gulf war, before the funeral of Princess Diana in 1997, after the death of the Queen Mother in 2002, and on the occasion of her Diamond Jubilee in 2012.
Reaction to her speech was close to rapturous, across the political spectrum.
“What an inspiring, steadying, reassuring Address by the Queen. Not a false note,” declared Nicholas Soames, a Conservative former member of Parliament and grandson of Winston Churchill, on Twitter.
Keir Starmer, the newly elected leader of the Labour Party, said, “The Queen speaks for the whole country, and our determination to beat the coronavirus.”
Still, the demands of social distancing have prevented the queen from playing the kind of highly visible role that she and previous monarchs have played during national emergencies. Her father and mother, Elizabeth, toured neighborhoods that had been bombed by the Germans during the Blitz in 1940 and 1941.
Elizabeth, who was known later as the Queen Mother, said after Buckingham Palace was bombed in September 1940 that she could “look the East End in the face,” referring to the working-class neighborhoods of East London.
Princess Elizabeth, the future queen, worked in the auxiliary service as a driver and truck mechanic during World War II. That experience left a lasting imprint on her and makes her a living link to Britain’s wartime experience.
In one of the most personal moments of her speech, the queen referred to her first radio address, recorded by her and her sister, Princess Margaret, in 1940 for children who had been evacuated from their homes for their safety.
“We should take comfort that while we may have more still to endure, better days will return,” the queen said. “We will be with our friends again; we will be with our families again; we will meet again.”
The last line referred to “We’ll Meet Again,” a 1939 song that became a wartime favorite in Britain.
With its appeal to wartime solidarity and its blunt acknowledgment of the trials to come, the speech had many of the same themes of her father’s address, memorialized in the 2010 film, “The King’s Speech,” which starred Colin Firth as George VI and Geoffrey Rush as his speech therapist.
“In this grave hour, perhaps the most fateful in our history,” the king said in halting cadences, “I send to every household of my peoples, both at home and overseas, this message.”
The coming conflict, he said, “will be hard. There may be dark days ahead, and war can no longer be confined to the battlefield.”
Stephen Castle contributed reporting.