Jacinda Ardern explained her decision to step down as New Zealand’s prime minister on Thursday with a plea for understanding and rare political directness — the same attributes that helped make her a global emblem of anti-Trump liberalism, then a target of the toxic divisions amplified by the coronavirus pandemic.

Ms. Ardern, 42, fought back tears as she announced at a news conference that she would resign in early February ahead of New Zealand’s election in October.

“I know what this job takes, and I know that I no longer have enough in the tank to do it justice,” she said. “It is that simple.”

Ms. Ardern’s sudden departure before the end of her second term came as a surprise to the country and the world. New Zealand’s youngest prime minister in 150 years, she was a leader of a small nation who reached celebrity status with the speed of a pop star.

Her youth, pronounced feminism and emphasis on a “politics of kindness” made her look to many like a welcome alternative to bombastic male leaders, creating a phenomenon known as “Jacindamania.”

Her time in office, however, was mostly shaped by crisis management, including the 2019 terrorist attack in Christchurch, the deadly White Island volcanic eruption a few months later and Covid-19 soon after that.

The pandemic in particular seemed to play to her strengths as a clear and unifying communicator — until extended lockdowns and vaccine mandates hurt the economy, fueled conspiracy theories and spurred a backlash. In a part of the world where Covid restrictions lingered, Ms. Ardern has struggled to get beyond her association with pandemic policy.

“People personally invested in her, that has alway been a part of her appeal,” said Richard Shaw, a politics professor at Massey University in Palmerston North, New Zealand.

“She became a totem,” he added. “She became the personification of a particular response to the pandemic, which people in the far-flung margins of the internet and the not so far-flung margins used against her.”

The country’s initial goal was audacious: Ms. Ardern and a handful of prominent epidemiologists who were advising the government held out hope for eliminating the virus and keeping it entirely out of New Zealand. In early 2020, she helped coax the country — “our team of five million,” she said — to go along with shuttered international borders and a lockdown so severe that even retrieving a lost cricket ball from a neighbor’s yard was banned.

When new, more transmissible variants made that impossible, Ms. Ardern’s team pivoted but struggled to get vaccines quickly. Strict vaccination mandates then kept people from activities like work, eating out and getting haircuts.

Dr. Simon Thornley, an epidemiologist at the University of Auckland, said many New Zealanders were surprised by what they saw as her willingness to pit the vaccinated against the unvaccinated.

“The disillusionment around the vaccine mandates was important,” Dr. Thornley said. “The creation of a two-class society and that predictions didn’t come out as they were meant to be, or as they were forecast to be in terms of elimination — that was a turning point.”

Ms. Ardern became a target, internally and abroad, for those who saw vaccine mandates as a violation of individual rights. Online, conspiracy theories, misinformation and personal attacks bloomed: Threats against Ms. Ardern have increased greatly over the past few years, especially from anti-vaccination groups.

The tension escalated last February. Inspired in part by protests in the United States and Canada, a crowd of protesters camped on the Parliament grounds in Wellington for more than three weeks, pitching tents and using parked cars to block traffic.

The police eventually forced out the demonstrators, clashing violently with many of them, leading to more than 120 arrests.

The scenes shocked a nation unaccustomed to such violence. Some blamed demonstrators, others the police and the government.

“It certainly was a dark day in New Zealand history,” Dr. Thornley said.

Dylan Reeve, a New Zealand author and journalist who wrote a book on the spread of misinformation in the country, said that the prime minister’s international profile probably played a role in the conspiracist narratives about her.

“The fact that she suddenly had such a large international profile and was widely hailed for her reaction really seemed to provide a boost for local conspiracy theorists,” he said. “They found support for the anti-Ardern ideas from like-minded individuals globally at a level that was probably out of scale with New Zealand’s typical prominence internationally.”

The attacks did not cease even as the worst of the pandemic receded. This month, Roger J. Stone Jr., the former Trump adviser, condemned Ms. Ardern for her Covid approach, which he described as “the jackboot of authoritarianism.”

In her speech on Thursday, Ms. Ardern did not mention any particular group of critics, nor did she name a replacement, but she did acknowledge that she could not help but be affected by the strain of her job and the difficult era when she governed.

“I know there will be much discussion in the aftermath of this decision as to what the so-called real reason was,” she said, adding: “The only interesting angle you will find is that after going on six years of some big challenges, that I am human. Politicians are human. We give all that we can, for as long as we can, and then it’s time. And for me, it’s time.”

Suze Wilson, a leadership scholar at Massey University in New Zealand, said Ms. Ardern should be taken at her word. She said that the abuse could not and should not be separated from her gender.

“She’s talking about not really having anything left in the tank, and I think part of what’s probably contributed to that is just the disgusting level of sexist and misogynistic abuse to what she has been subjected,” Professor Wilson said.

In the pubs and parks of Christchurch on Thursday, New Zealanders seemed divided. In a city where Ms. Ardern was widely praised for her unifying response to the mass murder of 51 people at two mosques by a white supremacist, there were complaints about unfulfilled promises around nuts-and-bolts issues such as the cost of housing.

Tony McPherson, 72, who lives near one of the mosques that was attacked nearly four years ago, described the departing prime minister as someone who had “a very good talk, but not enough walk.”

He said she fell short on “housing, health care” and had “made an absolute hash on immigration,” arguing that many businesses had large staff shortages because of a delayed reopening of borders after the lockdowns.

Economic issues are front and center for many voters. Polls show Ms. Ardern’s Labour Party has been trailing the center-right National Party, led by Christopher Luxon, a former aviation executive.

On the deck of Wilson’s Sports Bar, a Christchurch pub, Shelley Smith, 52, a motel manager, said she was “surprised” at the news of Ms. Ardern’s resignation. She praised her for suppressing the community spread of the coronavirus in 2020, despite the effects on the New Zealand economy. Asked how she would remember Ms. Ardern, she replied: “as a person’s person.”

That appeal may have faded, but many New Zealanders do not expect Ms. Ardern to disappear for long. Helen Clark, a former prime minister who was a mentor to Ms. Ardern, followed up her time in office by focusing on international issues with many global organizations.

“I don’t know she’ll be lost to the world,” Professor Shaw said of Ms. Ardern. “She may get a bigger platform.”

Emanuel Stoakes, Natasha Frost and Livia Albeck-Ripka contributed reporting.