LONDON — Britain’s embattled health minister, Matt Hancock, resigned on Saturday, a day after a tabloid newspaper published photos of him in a steamy embrace with one of his senior aides — an apparent violation of Britain’s social-distancing guidelines.
Mr. Hancock, who spearheaded Britain’s response to the coronavirus pandemic, was the latest member of Prime Minister Boris Johnson’s government to be accused of violating the strict rules imposed on the rest of the country.
“I understand the enormous sacrifices that everybody in this country has made — that you have made,” a chastened-looking Mr. Hancock said in a video statement released on Saturday evening. “Those of us who make these rules have got to stick by them, and that’s why I’ve got to resign.”
Initially, Mr. Hancock refused to step down and had the backing of Mr. Johnson. But with at least one Conservative member of Parliament demanding his resignation, and newspapers full of stories about double standards for the political elite, Mr. Hancock concluded his position had become untenable.
In a letter to the prime minister, Mr. Hancock wrote, “The last thing I would want is for my private life to distract attention from the single-minded focus that is leading us out of this crisis.” Mr. Hancock, who is married, apologized to his family and said he needed to be with his three children.
Mr. Johnson appointed Sajid Javid, a former chancellor of the Exchequer, to replace Mr. Hancock.
It was a swift fall from grace for an ambitious, 42-year-old cabinet minister, who had become a familiar figure over the long months of the pandemic. Mr. Hancock was a fixture at Downing Street news conferences, often exhorting the public to abide by lockdowns and other restrictions to try to curb the spread of the virus.
In the end, Mr. Hancock’s failure to live by his own rules undid him. The Sun published images — and later video — from a surveillance camera in Mr. Hancock’s office that showed him embracing and kissing Gina Coladangelo, a friend from college days at Oxford whom he had recruited as an adviser.
Newspapers reported that the images were recorded on May 6, when the restrictions in England still banned indoor social gatherings of people from different households. People were urged to stay two meters apart and avoid “face-to-face contact.” Those restrictions have since been relaxed.
Mr. Hancock acknowledged that he had breached the rules. On Friday, he said he was “very sorry” and had “let people down.” Downing Street initially said the prime minister had accepted Mr. Hancock’s apology and considered the matter closed.
Even before he was engulfed by scandal, Mr. Hancock had become something of a lightning rod for controversy. Two weeks ago, a former chief adviser to Mr. Johnson, Dominic Cummings, posted text messages between him and the prime minister in which Mr. Johnson described Mr. Hancock as “hopeless,” adding a profanity.
Mr. Cummings pinned much of the blame for Britain’s chaotic handling of the pandemic on Mr. Hancock, saying he had failed to set up a competent test-and-trace program and allowed the spread of the virus by moving elderly people from hospitals to nursing homes. Mr. Hancock flatly denied the charges.
Mr. Cummings himself came under fire a year ago for driving 260 miles to visit his parents in the north of England while the country was under a lockdown. He, too, refused to step down, and lasted another six months before Mr. Johnson ousted him.
The Labour Party, which has tried to make a political issue of the scandals in Mr. Johnson’s government, faulted him for not acting faster in this latest episode. “Matt Hancock is right to resign,” the Labour leader, Keir Starmer, said on Twitter. “But Boris Johnson should have sacked him.”
There are other lingering questions. One concerns the circumstances of Mr. Hancock’s hiring of Ms. Coladangelo, who is also married, as a non-executive director in the health department. She had previously worked for a fashion retailer, Oliver Bonas, founded by her husband, Oliver Tress.
Another concerns the placement of a surveillance camera in Mr. Hancock’s office. Some experts suggested it could have been done clandestinely to catch the minister in his private entanglements.
When the news of Mr. Hancock’s indiscretions broke on Friday, political analysts said he might survive the furor because he worked for Mr. Johnson, who has had his own messy private life and was recently married for the third time.
In a letter accepting Mr. Hancock’s resignation, Mr. Johnson credited him with building a network of field hospitals to handle the flood of Covid patients; deploying the drug dexamethasone to mitigate the effects of Covid; and securing protective gear for doctors and nurses.
“It has been your task to deal with a challenge greater than that faced by any of your predecessors,” Mr. Johnson wrote, “and in fighting Covid, you have risen to that challenge.”
Stephen Castle contributed reporting.