Joe Biden was sitting on a park bench outside the U.S. Capitol, as helpless in the moment as the rest of the nation. He had just arrived on an Amtrak train, the twin towers smoldering and a violent fire raging at the Pentagon — and his demands to enter the Capitol denied by security guards fearing a fourth plane was heading toward the building.

Outside, the veteran senator sat and fielded calls on his cellphone, eager to showcase that the foundations of American democracy would not be shaken. “I refuse to be part of letting these bastards win,” Biden said that day. At 2:12 p.m., records show, he connected with President George W. Bush for a two-minute call, urging him to return to Washington to display some sense of normalcy.

“This in a sense is the most godawful wake-up call we’ve ever had,” he said that afternoon.

That wake-up call would reshape the world in multiple ways, and few politicians would play a more central role — or for as long — as Biden, who has been inextricably bound to every stage of the wars over the past two decades: He began as a member of the ensemble in the Senate, became a supporting actor as vice president and finally became the leading man as president.

Biden’s arc on the global war on terrorism largely traces that of the nation — from enthusiastic supporter after 9/11 to strident critic in recent years — as he has adopted a far more cautious view of advice coming from the Pentagon.

Twenty years after the attacks of Sept. 11, 2001, President Biden commemorated the 2,977 lives lost in a pre-recorded speech. (The White House)

In the immediate aftermath of the 2001 attacks, as chairman of the Senate Foreign Relations Committee, he was among those advocating for war. A decade later, as vice president, he was engaging in increasingly heated debates inside the Situation Room when he argued for a more narrowly defined mission and fewer troops than the military wanted, as well as his controversial skepticism about the mission that killed Osama bin Laden. And now, on the 20th anniversary of the attacks, he is the president who just brought the final U.S. troops home from Afghanistan, where the terrorist attacks had been planned.

But Biden is finding that closing the book on the 9/11 era after two decades, as he promised during the 2020 campaign, is fraught with new perils and political uncertainty. The chaotic exit from Afghanistan last month showcased the challenges in the country in a way that Biden argued was the very reason for leaving. But his decision also has triggered warnings — in some cases from the same national security advisers Biden has rebuffed through multiple administrations — that his decisions have erased much of the work done over 20 years and effectively returned Afghanistan to the same place it was before any American involvement.

Biden entered his presidency with an unwavering conviction that he was right to end the “forever wars,” and was unlikely to be swayed by any military pitch or nuance.

“I think he brought with him the experiences that he had on the inside, and maybe some would say to a fault,” said David Axelrod, a former adviser to President Barack Obama who sat in many meetings with Biden. “But I think he was not going to be receptive to arguments about why we should stay just a little longer, because he had heard these arguments for decades, and was deeply skeptical of them.”

Just as the attacks 20 years ago caused him, and the country, to adopt significant foreign policy changes, Biden appears determined as president to mark another shift. He is attempting to oversee an emerging Biden doctrine that deploys fewer troops and relies instead on precision counterterrorism operations, one that presses diplomatic solutions and depends on the patience of sanctions rather than shock and awe of the military.

Some — particularly former military officials who disagree with Biden’s decision, and the execution of it — have warned that Afghanistan could again become a safe haven for terrorism. They view the Sept. 11 anniversary as not so much as a bookend but the end of a chapter in a story that is not yet complete.

“Obviously you’re going to remember all of those who got killed on 9/11 and their families and all of those who fought and sacrificed over these last 20 years to make sure 9/11 wouldn’t happen again and Afghanistan would not become a safe haven for terrorists,” said Leon Panetta, who served as CIA director and defense secretary under Obama. “But you have on the 20th anniversary a bitter reality that once again the Taliban control Afghanistan.”

“I think it is in many ways a wake-up call that the war on terrorism is far from over,” he said.

Like most Americans, Biden began the post-9/11 era determined to avenge the attacks and convinced, albeit with some reservations, that the country would be safer for the deployment of American military power in Afghanistan, as well as Iraq.

But as the war in Afghanistan lingered, Biden’s skepticism increased. Although he had supported the wars in Afghanistan and Iraq, Biden later came to see both conflicts as damaging to American credibility.

“Clearly he felt like we had to go into Afghanistan and for all the reasons everyone said,” said Ted Kaufman, a longtime aide and confidant who also was appointed to serve the remainder of Biden’s term in the Senate. “But as soon as we moved from the original objective, which was go in there and make sure they never committed a 9/11 — as soon as that turned into nation-building, that’s when they lost him.”

While Biden did not join the antiwar protest movement in his youth, his formative experience growing up was the Vietnam War. Increasingly, Kaufman said, Biden began to worry about Afghanistan becoming another Vietnam, with protracted battles and costing more American lives.

His son Beau would also soon join the Delaware National Guard, deployed to Iraq in 2008.

“Does it deepen it when your son is in the military? I can’t believe it doesn’t,” Kaufman said. “But he had already made his commitment coming out of Vietnam to the troops, and the importance not to put them in harm’s way without it being vital to our national security.”

By 2008, after several visits to Afghanistan, Biden began seeing the war as faltering, but still winnable.

But he also would begin to doubt the viability of the Afghan government. During one visit just before being sworn in as vice president, Biden and Sen. Lindsey O. Graham (R-S.C.) had a heated dinner with Afghan President Hamid Karzai.

Biden ticked through a list of Obama administration complaints, including corruption within Karzai’s government and alleged criminal ties in his own family, but Karzai countered with his own complaints. When he accused Americans of indifference to civilian deaths, Biden abruptly ended their meal.

“He came back with a pretty clear assessment, and essentially the assessment was highly critical of the governance situation in Afghanistan at that time,” said Tom Donilon, who served as national security adviser under Obama and is the brother of one of Biden’s closest advisers, Mike Donilon. “And that assessment I think informed his view as we went into the discussions in 2009 about the right way forward.”

Within the Obama administration debates, Biden was constantly questioning and frequently irritating officials at the Pentagon. Then-Defense Secretary Robert M. Gates said that Biden was subjecting Obama to “Chinese water torture.”

“Joe kind of played the role of challenging the kind of status quo,” Panetta said. “He always accepted the president’s decision and was willing to back it up when the president made the decision. It wasn’t an issue that cast him in any way disloyal. He really viewed that the best expression of his loyalty was to raise questions that nobody else wanted to raise.”

Biden was also skeptical about the raid that killed bin Laden, one of the primary reasons U.S. troops got involved in the region in the first place. At the time, Biden believed more needed to be done to confirm bin Laden was in the compound in Pakistan and he vocalized some of his dissent. He later claimed that he told Obama privately, “Follow your instincts.” Obama authorized the successful raid.

Biden’s view that the war in Afghanistan was unwinnable crystallized during the run-up to the troop surge under Obama, and he has held to that conviction ever since. Announcing in April that he would withdraw American troops within months, Biden did not try to paint the war as a victory. Instead, he suggested the war had become irrelevant — a relic of the post-9/11 hunt for terrorists that no longer fit the threats of 2021.

“We went to Afghanistan because of a horrific attack that happened 20 years ago,” Biden said then. “That cannot explain why we should remain there in 2021.”

Biden shared Obama’s commitment to closing Guantánamo, which remains open as a prison for suspected al-Qaeda terrorists 12 years after Obama and Biden took office.

“He sees all that and he probably comes out of the Obama administration frustrated that instead of pulling us out, in some ways we went deeper in,” said University of Pennsylvania law professor Claire Finkelstein.

Biden has recommitted to closing the prison, but there is no set plan.

Biden followed up with an announcement in July that the American combat mission in Iraq would also end, although some noncombat forces will remain. The withdrawals punctuate Biden’s effort to pull the United States out of the long shadow of the Sept. 11 attacks, and the foreign policy era defined by the hunt for terrorists around the world.

“By the way, in a lot of what he talked about 10-plus years ago has turned out to be accurate, about whether or not the conditions were there for a successful counterinsurgency campaign, and they were not there,” Donilon said. “It’s been consistent, it’s rooted in analysis and firsthand observation. It was taken through a rigorous analytical process.”

In a video released Friday, Biden focused remarks on those who died on Sept. 11, 2001 — and the heroism displayed by average Americans on that day — only briefly alluding to fighting terrorism and not mentioning the wars in Afghanistan and Iraq.

“Unity is what makes us who we are,” Biden said. “To me, that’s the central lesson of Sept. 11. It’s that, at our most vulnerable, in the push and pull of all that makes us human, in the battle for the soul of America, unity is our greatest strength.”

After visits to 9/11 sites on Saturday, Biden is planning, as he did 20 years ago, to go home to Wilmington, Del. That time, he had to catch a ride with then-Rep. Robert A. Brady (D-Pa.), who was heading to Philadelphia. This time, he’ll fly on Marine One.