In the three weeks between US President Joe Biden's disastrous debate and his decision to step away from the 2024 ticket, one woman emerged as the key driver of efforts to push the Democratic Party towards a historic decision.
Nancy Pelosi, a former house speaker and party elder, has been a colleague and ally of Joe Biden for more than three decades.
"Their strong friendship is rooted in a shared dedication to public service, and devotion to their families and their faith," Biden spokesman TJ Ducklo told the Washington Post in 2021.
But while they may share common values and mutual respect, the two influential Democratic figures recently found themselves at odds over the 2024 presidential race — and who should be at the top of the ticket.
Pelosi is unapologetically a political animal, one who wants to win and is deeply committed to keeping Republican presidential nominee Donald Trump out of power.
"I'm more reptilian, cold blooded, to win the election," she said in 2023 about her dedication to ensuring a Democrat kept control of the White House.
For a long time, she and members of her party believed Biden was their best chance at achieving such an outcome.
But the presidential debate changed everything, turning the tide of voter opinion against Biden.
As Democrats saw their chances of winning the November poll slipping away, a few members privately entreated the president to reconsider his options.
When that failed, they became more public, launching a full-scale effort to convince him to step aside.
Pelosi appears to have been a key figure in these talks.
"Nancy made clear that they could do this the easy way or the hard way," one Democrat told Politico.
"She gave them three weeks of the easy way. It was about to be the hard way."
While the former house speaker never called directly for the president to stand aside publicly, behind the scenes she was reportedly discussing Biden's precarious position with anxious Democrats and offering to be their soundboard.
Longtime allies and observers of the former speaker told US media that Pelosi's position wasn't surprising and she has always been a "vote counting tactician" who knows how to win.
But even for a political operator with decades of experience, taking on the president was a high-stakes gamble.
Here's how she pulled it off.
Pelosi's influence within the Democratic Party
Nancy Pelosi was once one of the most powerful women in US politics.
The scion of an influential Democratic family — her father was a congressman and her brother a mayor of Baltimore — the mother of five swiftly rose through the ranks of the party before she was elected to Congress in 1986.
From there she went on to become Democratic house speaker from 2007 to 2011 and 2019 to 2023, occupying one of the highest positions in America's capital and becoming the only woman to have achieved such a rank.
It made her a target for criticism from America's far right, who dismissed her as nothing more than an elitist liberal and regularly featured her in their attack ads.
Left-leaning members of her own party also apparently felt, at times, frustrated by her positions, becoming fed up with her commitment to a centrist political agenda and what they perceived as her sluggishness in moving to impeach Trump.
But her ability as speaker to secure votes for much-needed legislation as well as the loyalties of those around her was undeniable.
Even after leaving the speakership in 2023, she remains a figure who wields enormous influence within the Democratic Party.
"Nancy Pelosi has been an outsize figure in the Democratic Party really for decades … she is a power broker in the party and as speaker of the house ran a very tight ship with the Democrats," says Emma Shortis, US expert and senior researcher at the Australia Institute.
"I think she's renowned for her ability, really, to herd cats."
A combination of skilled negotiation tactics, natural political instincts and a gift for fundraising, has cemented her status in the party as someone to listen to — and one who should never be crossed.
"She'll cut your head off and you won't even know you're bleeding," Alexandra Pelosi once said of her mother's approach to her opponents.
"No-one has ever won betting against Nancy Pelosi."
For most of her political life, Pelosi used those skills to secure the upper hand against Republicans.
But when her vision for a Democratic victory in 2024 was put under threat, Pelosi marshalled her political skills to take on the most powerful man in the party: the president.
'Time is running short'
Watching the presidential debate was excruciating for Joe Biden's supporters and friends.
Within the first few minutes, it was clear that something was seriously wrong. As he stumbled through answers and lost his train of thought, he looked and sounded out of sorts.
Critics delivered a verdict on his "poor" debate performance, drawing allies to publicly rally around him in the aftermath, including Pelosi.
In an appearance on CNN on June 30, the former speaker — who was introduced as a 'close ally' of the president — asked people to not make a judgement based on "one debate".
There was perhaps a slip of the tongue when she used the past tense to describe Biden’s time in power: "It was a bad night, it was a great presidency."
But she argued there had been little change in the polls since then and warned that trying to choose another nominee "could be chaotic".
Biden attempted to right the ship, declaring in an interview on ABC America that he'd stand aside only if "Lord Almighty" told him to, but it wasn't enough to allay the fears of his own party.
By the time Pelosi gave her next interview on July 10, she had a different message for the president.
In a 10-minute appearance on "Morning Joe", which is watched by the president, she carefully sidestepped a question about whether Biden should run.
Instead, she slyly suggested: "It's up to the president to decide if he is going to run. We're all encouraging him to make that decision because time is running short."
Of course, Biden had already written a letter to Congress that he was "firmly committed to staying in this race", prompting observers to read between the lines of Pelosi's deliberate choice of words.
While she didn't outright say he should leave the race, Dr Shortis said Pelosi's "carefully calibrated comments" were "clearly coded for him".
But if Biden heard the message, he appeared to have ignored it.
"I think there would have been disappointment that he didn't read that writing on the wall," Dr Shortis said.
Inside the Democrats' rebellion
A day later, Biden attempted to play the elder statesman as he hosted the leaders of NATO in Washington.
Far from easing people's concerns, however, there were more stumbles in the public eye.
He introduced Ukrainian president Volodymyr Zelenskyy by the name of his arch-rival, Vladimir Putin, and in a rare press conference, called his own rival, Donald Trump, the vice-president.
With the Democrats facing an avalanche of negative headlines, Pelosi reportedly picked up the phone and told aides, colleagues and even the president that she was sceptical he could win.
When asked about the details of these calls by the press, a Pelosi spokesperson refused to go into detail.
"Sadly, the feeding frenzy from the press based on anonymous sources misrepresents any conversations the speaker may have had with the president," they told CNN.
But there was no denying the pressure was building on Biden, with some of those closest to Pelosi publicly coming out against him.
Notably, Congressman Adam Schiff, said on July 17 that it was time for Biden to "pass the torch", a statement observers believed was likely sanctioned by Pelosi, given her position as his mentor and close ally.
"It was very clear [to] power brokers in the party, alongside Pelosi and particularly big donors, and even, a significant amount of American people, if you looked at the polling, the number of Democratic voters who wanted Biden to step outside was high and it was growing," Dr Shortis said.
"So the risk of being seen, I think, as kind of operating behind the scenes in that way was much smaller than the risk of doing nothing."
Pelosi wasn't the only influential figure growing hesitant of the president's chances in November.
Barack Obama, a longtime confidant of Biden, was heavily engaged with the president's campaign in the early months of this year, making calls to the White House chief of staff and relaying advice to top aides, according to US media.
But though he defended Biden after the debate, he remained silent as his former aides came out against the president.
"There have always been two Joe Bidens. The empathetic, decent, big-hearted leader, forged in loss and grief, finding the good in his friends and opponents, in love with America, arms wide and open with space for everyone," Jon Lovett, a former Obama speechwriter and Pod Save America co-host, wrote on X.
"And there's the blowhard with a chip on his shoulder, stubborn, something to prove, his fellow senators rolling their eyes as the finger wags harder and the stories get longer. Statesman and politician, hero and fool."
Obama was also taking calls from congressional leaders, Democratic governors and key donors in which he shared their unease about the prospects for Biden's campaign.
While he was careful not to share his view on whether the president should step down, his presence was said to have brought a "Shakespearean quality to the drama now playing out, given their eight-year partnership".
Meanwhile, other influential Democrats, including Senate Majority Leader Chuck Schumer and House Democratic Leader Hakeem Jeffries, were weighing in on the president's future in the race.
With the pressure campaign mounting, Joe Biden eventually set aside his personal ambition and made a decision for the good of the party.
Did Biden get the final say?
When the president ultimately bowed out of the race, he was isolated, struck down with a poorly-timed illness and confronting some disastrous polling numbers.
But despite being abandoned by some of those closest to him, he still retained the heft of the presidency and commanded huge respect within the party.
He used that power to ensure that he got the final say in who succeeded him.
After he announced that he would no longer be contesting the election, he fully backed in Kamala Harris as the heir apparent.
Loading Twitter content
"My very first decision as the party nominee in 2020 was to pick Kamala Harris as my Vice President," he wrote on X.
"And it's been the best decision I've made."
As the next-in-line to the president, Harris has been right beside him throughout the campaign, making her potential takeover more seamless than with any other candidate.
But Pelosi and others weren't initially convinced the position should immediately fall to the vice-president.
The former speaker was reportedly in favour of an open nomination process at their national convention in August, despite the risk it posed to the party's image as one of disunity.
In a leaked account of a closed-door California Democrat meeting in early July, which was reported by the New York Times, Pelosi told colleagues she favoured a competitive process to find the president's replacement.
One person familiar with her thinking told the newspaper she believed it would strengthen the candidates' chances of winning the general election.
But Biden's solid backing of Harris disrupted those plans. His endorsement of his VP was quickly echoed by former president Bill Clinton and former secretary of state, Hillary Clinton, in a move that appeared tactical and orchestrated.
In the critical 12 hours after Biden had withdrawn from the race, there was a deluge of endorsements for Harris.
Importantly, all the other politicians who'd been mentioned as challengers to the VP — people like Transportation Secretary Pete Buttigieg, Californian Governor Gavin Newsom and Michigan Governor Gretchen Whitmer — endorsed Harris and thus ruled themselves out of contention.
Dr Shortis said it was a sign the party had clearly made the decision to unify behind Harris "in an attempt to leave the chaos of the last few weeks behind them".
"I think that was very much deliberate on Biden's part," she said.
Ultimately, Pelosi's role in Biden's ousting from the top of the ticket may never be fully understood.
But whatever her position, the president can claim to have had a greater say in choosing his replacement and ushering in a new era for the party.
It may offer some cold consolation in the months ahead.