Analysts said they could not recall a career civil servant quitting in such a spectacle.

Opposition Labour Party officials said the resignation laid bare the government’s drive to stamp out any internal dissent. Jon Trickett, the party’s spokesman on civil service questions, said on Twitter that it showed “the underlying right-wing authoritarian but incompetent nature of the Johnson government.”

The dispute calls into question the future of Ms. Patel, a hard-line Brexiteer who is known for her tough talk on crime and immigration, and for her skepticism about the merits of foreign aid. The daughter of Indian immigrants who came to Britain via Uganda, she is close to Mr. Johnson and has emerged as perhaps the most powerful woman in his government.

But Ms. Patel has been a lightning rod for criticism throughout her career. In 2017, Mr. Johnson’s predecessor, Prime Minister Theresa May, dismissed her from the post of International Development secretary after she held unauthorized meetings with several Israeli officials, including Prime Minister Benjamin Netanyahu, during what was supposed to be a family visit to the country.

Ms. Patel did not immediately issue a statement on Saturday afternoon in response to Mr. Rutnam’s resignation. The head of the civil service, Cabinet Secretary Mark Sedwill, said in a terse statement to the BBC: “I have received and accepted with great regret the resignation of Sir Philip Rutnam. I thank him for his long and dedicated career of public service.”

A graduate of Cambridge and Harvard, Mr. Rutnam previously held positions in the Treasury and the Department of Transport. In 2018, he was appointed a Knight Commander of the Order of the Bath, which added a Sir to his name.

Mr. Rutnam acknowledged that Mr. Sedwill had offered him a financial settlement to leave quietly. But Mr. Rutnam said that he planned instead to sue the Home Office for “constructive dismissal,” a legal term for being forced out of a job. That raised the prospect of public legal hearings that could air further embarrassing details about Ms. Patel’s treatment of her staff.

Mr. Rutnam’s statement already offered plenty of grist for her critics. He said he did not believe Ms. Patel’s denials that she had orchestrated a whispering campaign against him with the news media. Despite their falling out, Mr. Rutnam said, he had tried to reconcile with her at the request of Mr. Sedwill and the prime minister. Ms. Patel, he said, refused to engage with him.