WASHINGTON, D.C. (AP) — Last Fourth of July, President Joe Biden gathered hundreds of people outside the White House for an event that would have been unthinkable for many Americans the previous year. With the coronavirus in retreat, they ate hamburgers and watched fireworks over the National Mall.

Although the pandemic wasn’t over yet, Biden said, “We’re closer than ever to declaring our independence from a deadly virus.” Across the country, indoor masking requirements were falling as the number of infections and deaths plummeted.

Within weeks, even some of the president’s allies privately admitted that the speech had been premature. Soon the administration would learn that the delta variant could be transmitted by people who had already been vaccinated. Masks went back on, then came polarizing vaccination mandates. The even-more-contagious omicron variant would arrive months later, infecting millions and causing chaos during the holiday season.

“We were hoping to be free of the virus, and the virus had a lot more in store for us,” Joshua Sharfstein, vice dean of the Johns Hopkins Bloomberg School of Public Health, said.

The number of people in the United States who died from COVID-19 nearly doubled, from 605,000 to more than 1 million, over the past year.

That sunny speech one year ago marked a crossroads for Biden’s presidency. The pandemic appeared to be waning, the economy was booming, inflation wasn’t rising as quickly as today and public approval of his job performance was solid.

As Biden approaches his second Fourth of July in the White House, his standing couldn’t be more different. A series of miscalculations and unforeseen challenges have Biden struggling for footing as he faces a potentially damaging verdict from voters in the upcoming midterm elections. Even problems that weren’t Biden’s fault have been fuel for Republican efforts to retake control of Congress.

The pandemic’s resurgence was swiftly followed last summer by the debacle of the U.S. withdrawal from Afghanistan, when the Taliban seized control of the country faster than the administration expected as the U.S.-backed regime collapsed. Then, negotiations over Biden’s broader domestic agenda stalled, only to collapse altogether in December.

The Russian invasion of Ukraine in late February caused a worldwide spike in gas prices, exacerbating inflation that reached a 40-year high. Another blow came last month, when the Supreme Court overturned the constitutional right to abortion under Roe v. Wade and curtailed the Environmental Protection Agency’s ability to regulate greenhouse gas emissions.

Suddenly a reactive president, Biden has been left trying to reclaim the initiative at every step, often with mixed results. The coronavirus is less of a threat than before and infections are far less likely to lead to death, but Congress is refusing to supply more money to deal with the pandemic.

He signed new gun restrictions into law after massacres in New York and Texas, and he’s leading a reinvestment in European security as the war in Ukraine enters its fifth month. But he has limited tools at his disposal to deal with other challenges, such as rising costs and eroding access to abortion.

“People are grouchy,” Lindsay Chervinsky, a presidential historian, said.

The latest poll from The Associated Press-NORC Center for Public Affairs Research shows that his approval rating remains at 39 percent, the lowest since taking office and a steep slide from 59 percent one year ago. Only 14% of Americans believe the country is headed in the right direction, down from 44 percent.

Douglas Brinkley, another historian, said Biden suffered from a case of presidential hubris after a largely successful run in his first five months in office, which included an overseas trip to meet with allies excited about welcoming a friendly face back to the international scene. He compared Biden’s Fourth of July speech last year to President George W. Bush’s infamous “Mission Accomplished” moment during the second Iraq War.

“He was trying to deliver good news but it didn’t pan out for him,” Brinkley said. “Suddenly, Biden lost a lot of goodwill.”

White House officials reject the comparison, noting that Biden warned about the “powerful” delta variant in his 2021 speech. Chris Meagher, a spokesman, said deaths from the virus are at a record low now, reducing disruptions in workplaces and classrooms.

“Fighting inflation and lowering prices is the president’s number one economic priority, and he’s laser focused on doing everything he can to make sure the economy is working for the American people,” he said. “And we’re in a strong position to transition from our historic jobs recovery to stable and steady growth because of the work we’ve done to bring the pandemic under control. COVID is not the disruptive factor it has been for so long.”

The promise to competently address the COVID-19 pandemic is what helped put Biden in the Oval Office and send President Donald Trump to defeat. From the start of Biden’s tenure, his public pronouncements were sober and cautious, wary of following his predecessor in predictions that went unfulfilled. The nation’s vaccination program found its stride under Biden, and by April 19, 2021, all adults were eligible to be vaccinated.

Michael Osterholm, director of the Center for Infectious Disease Research and Policy at the University of Minnesota, was an adviser to Biden’s transition team. But as the Fourth of July approached last year, he was worried and felt that the administration wasn’t heeding his warnings.