Prime Minister Keir Starmer of Britain tried on Monday to quell a mutiny in the governing Labour Party, responding to growing demands from lawmakers that he resign by promising to take urgent action to lower the cost of living and to move Britain closer to Europe.

In a speech in London, Mr. Starmer acknowledged the anger expressed by voters last week when they overwhelmingly rejected Labour Party candidates for municipal council seats across England and in elections for the Scottish and Welsh parliaments.

“That hurts and it should hurt,” he said. “I get it. I feel it. And I take responsibility.”

But he also vowed to fight to stay in his job, saying a change in leadership would be chaos for the country, referencing the succession of prime ministers from the Conservative Party, or the Tories, in the years before Labour won the general election in 2024.

“I take responsibility for not walking away,” he vowed. “Not plunging our country into chaos, as the Tories did time and again. Chaos that did lasting damage to this country. A Labour government would never be forgiven for inflicting that on our country again.”

Some of Mr. Starmer’s critics said shortly after the speech that the prime minister did not do enough to reassure them that he was the best person to lead the country. But Catherine West, a Labour lawmaker who over the weekend had said she would attempt to trigger an immediate leadership challenge, retreated a little from her initial threat and asked for support from colleagues for Mr. Starmer to set a timetable for his departure in a few months’ time.

“I have reluctantly concluded that this morning’s speech was too little, too late,” she said in a statement. “The results last Thursday show that the prime minister has failed to inspire hope. What is best for the party and country now is for an orderly transition.”

Ms. West said she would begin circulating a letter to her colleagues urging them to join her in demanding that Mr. Starmer cleared the way for a party leadership election in September. The party retains a large majority in the British national Parliament, and a replacement for Mr. Starmer as its leader would also replace him as prime minister.

Mr. Starmer’s position has been eroding for months as he has struggled to confront a sagging economy, anger about illegal immigration and the perception that he is weak and indecisive. His decision to appoint Peter Mandelson as ambassador to the United States became a scandal when documents revealed the extent of Mr. Mandelson’s friendship with Jeffrey Epstein, the convicted sex offender.

But the disastrous elections for Labour last week were the final straw for many of his critics. Labour lost more than 1,400 seats on the local councils and was heavily defeated in Wales after decades in power there. Reform U.K., the right-wing populist party led by Nigel Farage, posted victories across Britain, despite winning under 30 percent of the vote in a fractured field of several political parties.

Over the weekend, dozens of Labour lawmakers demanded that Mr. Starmer step down as prime minister. Angela Rayner, a former member of Mr. Starmer’s cabinet who is considered one of the lawmakers who might challenge him, said in a statement on Sunday that the party’s agenda must change.

“The prime minister must now meet the moment and set out the change our country needs,” she wrote. “Labour exists to make working people better off. That is not happening fast enough, and it needs to change — now.”

Ms. Rayner did not formally launch a challenge to the prime minister, a process which requires gathering the signatures of 80 other lawmakers to trigger a party election.

Mr. Starmer, who is just two years into a five-year term, has repeatedly blamed the country’s troubles on the Conservative Party, which ruled the country for 14 years before Labour’s 2024 victory. In his speech, Mr. Starmer acknowledged that his efforts to change direction have not convinced Britain’s voters.

“I’ve spent too much time talking about what I’m doing for working people,” he conceded, “and not enough time talking about why or who I stand for.” He said that he needed to make his case to “millions of people who don’t get the dignity, the respect, the chance that they deserve to go as far as their talent and effort should take them.”

“I am fighting for them,” he said. “We are fighting for them. I am their prime minister, and this is their government.”

But it is unclear whether Labour Party lawmakers, already impatient with Mr. Starmer, are prepared to give him more time to address the concerns of their constituents. Many Britons are frustrated by long waiting lists for health care services, rising taxes and fuel prices, and the cost of housing.

Mr. Starmer helped Labour win in 2024 in part by promising not to seek a complete reversal of the Brexit vote that severed Britain from the European Union. In his speech on Monday, Mr. Starmer said that promise still stood, but argued that Britain must get closer to the rest of the continent for the country’s economy to improve.

“This Labour government will be defined by rebuilding our relationship and by putting Britain at the heart of Europe,” he said. “So that we are stronger on the economy, on trade, on defense, you name it.”