AUGUST 31ST marked the end of America’s 20-year campaign in Afghanistan. It also marked the end of President Joe Biden’s worst month in office. The electorate’s mood had long soured on the intervention; ending the “forever wars” was a campaign promise of both Mr Biden and of Donald Trump. Even so, many Americans were appalled once the immediate ramifications of withdrawal became visible. They included the swift collapse of the Afghan government, the scenes of human tragedy during the evacuation at Kabul airport and the Islamic State Khorasan Province (ISKP) suicide bombing soon after that killed at least 180 people, including 13 American soldiers. Mr Biden would desperately like to turn to the next chapter of his presidency. It will not be so simple.

In a speech to mark the day, Mr Biden was at turns angry, defiant and unrepentant. He began by lauding the evacuation effort as an “extraordinary success.” “No nation has ever done anything like it in all of history,” he boasted. To critics who argued the extraction could have been better handled, the president said “I respectfully disagree”. Those who insisted that a low-grade deployment of American soldiers could have remained did not understand that there was no such thing as low-grade war, he countered.

“I made a commitment to the American people that I would end this war,” he said proudly. His speech was steeped in brutal realpolitik, almost Nixonian. Mr Biden argued that America had essentially squandered $2trn in a country that had long ceased to present any clear national-security interest, and in the process had spoiled America’s ability to deal with modern challenges like China and Russia.

The stain of Vietnam kept Lyndon Johnson from seeking re-election. Things are not that bad for Mr Biden, but his presidency has taken a clear blow. On August 1st he held a net-approval rating of 8.1 points, according to an average computed by FiveThirtyEight, a data-journalism outfit. By the end of the month, Mr Biden was slightly underwater at -0.4 points (our polling—see chart—shows a smaller decline). Part of this may be due to what political scientists call “differential partisan non-response”—essentially the tendency for partisan supporters to shirk pollsters when their man is having a bad week, or a bad month. Most presidents face a gradual drop in approval after the honeymoon period of the inauguration, and Mr Biden was no exception to this trend, perhaps as a result of the sudden strength of the Delta variant. Still, an abrupt 8.4 percentage-point slide is not easily shrugged off. For comparison, in the aftermath of the attack on the Capitol on January 6th, Mr Trump suffered a ratings slide of nine points, albeit from a lower base.

It’s clear that Americans are blaming the president for his mishandling of the Afghan situation, despite his defiance. Polling from YouGov (taken before the ISKP attack at the Kabul airport) shows that just 33% of Americans approve of the president’s handling of Afghanistan. Only 16% of Americans (and, remarkably, just 28% of Democrats) say that the evacuation has been handled well (see chart). Such is the pall cast by the chaos, that even the public’s firm anti-interventionism looks to be shaken. At the start of July, an overwhelming majority of Americans, 70%, supported the planned withdrawal of all troops by September 11th, 2021. Now they are evenly divided on whether leaving was a mistake.

Public opinion is shaped by elites, and Mr Biden has taken sustained criticism from all quarters. That from Republicans was expected, even if inconsistent with their approval for the withdrawal agreement struck by the Trump administration with the Taliban. Having previously criticised Mr Biden for not adhering to Mr Trump’s earlier deadline of complete withdrawal by May 1st, Josh Hawley, an ambitious Republican senator, has now called on Mr Biden to resign. But Democrats in Congress have also condemned the administration’s planning as riven with “failures”. Their committees are planning to investigate the debacle. Mainstream news outlets, which Democrats still trust, turned against Mr Biden in a way that the conservative media never did against Mr Trump.

If Mr Biden is at the nadir of the Afghan affair, his presidency is salvageable. Slides in approval ratings can revert. Americans have relatively little interest in foreign affairs. Even now, they rank national security as only the seventh-most-important issue for the country. The next opportunity for voters to punish Mr Biden will be in the midterm elections held in November 2022—an eon away in American politics. Even if his foreign-policy judgment looks much more questionable now, American voters have not decided an election principally on that point since 2004.

But the Afghan debacle could still linger. Republicans are split over whether to criticise Mr Biden for leaving allies behind or allowing floods of Afghan refugees into America (though, like all refugees entering America, they will be thoroughly vetted). Scenes of women being abused or forced into burqas could also prove politically damaging, as could stories about Afghans who helped Americans but were unable to leave the country being killed. And the White House estimates that fewer than 200 Americans who wish to leave remain in the country (for all the criticism of the evacuation, America and its allies got 120,000 people out of Afghanistan after the government collapsed). If any of them were to be harmed, especially by ISKP, it would trigger another harsh round of criticism.

September is supposed to be a different sort of month for the White House. Mr Biden’s proposal to “build back better” after the covid-19 pandemic by spending $4trn on infrastructure and a much-expanded safety-net will be thrashed out in Congress. Turmoil abroad is unlikely to alter the Democratic calculus on stimulus because of a slide in the president’s approval ratings, and Mr Biden is not so odious to his party that he will suffer major defections over his domestic agenda. And Democrats already needed little extra incentive to quickly cobble together a passable package. Time is not on their side. Since 1935, only two incumbent presidents have improved their party’s congressional margins in midterm elections. Unified government is a rare gift in Washington. Democrats are unlikely to let it go to waste.