When the Republicans held on to their Senate majority on the night Donald Trump was elected president, things looked truly bad for Barack Obama’s signature healthcare law. The general assumption was that, with control of both houses of Congress and the White House, the GOP would find a way to make good on seven years’ worth of campaign promises to end the Affordable Care Act (ACA), which expanded healthcare to nearly 20 million people.

But early Friday morning, three Republican senators – Susan Collins, Lisa Murkowski and John McCain – abandoned their party and upset the math. In joining Democrats to vote down a measure that threatened healthcare for millions, the trio resisted intense pressure from their party leadership and hard-knuckle tactics by the president.

Here’s a look at the three:

John McCain

It was just two days ago that John McCain returned to Washington to a hero’s welcome, applauded by both parties and by Trump himself. Less than a week earlier, the Arizona senator had been diagnosed with a glioblastoma, an aggressive brain cancer that in 2015 killed former vice-president Joe Biden’s son.

McCain spent 20 years in the US navy, and five years in a prisoner-of-war camp in Vietnam after his plane was shot down in 1967. He broke one leg and both arms, nearly starved in a filthy Vietnamese prison, and taught himself how to walk again.

Many of McCain’s former colleagues, and presidents from both sides of the aisle, have noted that record of service and called him a “fighter”. One peer, the former Michigan congressman John Dingell, called McCain “tough as $2 steak”, an unintentional harbinger of things to come.

“So great that John McCain is coming back to vote. Brave – American hero! Thank you, John,” said Trump, about the man whose service record he had insulted during the election campaign.

Why did McCain return to the Senate so soon? Many, probably including Trump, assumed McCain’s intention was to vote yes on a repeal of the ACA, popularly known as Obamacare – a goal he said on Thursday he still held. But that would turn out to be a shallow prediction.

Alongside Murkowski and Collins, McCain cast the decisive vote to sink the Republican healthcare effort, giving the bill a dramatic thumbs down as he said no on the Senate floor.

McCain had long shown a distaste for the bill. Asked about his comfort level with the process to repeal healthcare in June, which was criticized as opaque, he said: “None.” Prior to the vote on Thursday, he joined Lindsey Graham in bashing the so-called skinny repeal, a short, Republican-authored misnomer of a bill with big consequences for 16 million people predicted to lose health insurance over the next decade.

The difference between McCain and Graham? Graham voted yes; McCain voted no. McCain, along with many other senators who eventually voted yes, worried the bill they passed could become law if the House took it up without first trying to hash out the details.

“We must now return to the correct way of legislating,” said McCain, calling for bipartisanship and an open legislative process. “We must do the hard work our citizens expect of us and deserve.”

Susan Collins

Collins is the most consistently moderate Republican in the Senate, and one of just five Republican women. She and Murkowski formed what could be described as a team of two on healthcare – both voted against bringing the “skinny repeal” to the floor, and both are from largely rural states that have struggled to contain healthcare costs.

Their votes did not go unnoticed. A House member and Republican from Texas, Blake Farenthold, challenged Collins to a duel, “Aaron Burr-style”, because “some female senators from the north-east” were blocking healthcare reform.

Collins was ahead of most other elected Republicans in rejecting Trump, telling the New Yorker in June 2016 that she might even vote for Hillary Clinton. “I do not anticipate voting for her this fall,” Collins said, but “I’m not going to say never.”

Collins voted against the original ACA legislation in 2010, and has toed the party line on votes such as the confirmation of the attorney general, Jeff Sessions. However, Collins has broken with her party on major issues including the environment, background checks for gun sales, same-sex marriage, funding for Planned Parenthood and, notably, Donald Trump.

In the current Congress, Collins has broken ranks to vote against Trump’s positions more than any other elected Republican, according to a FiveThirtyEight analysis. Heritage Action, the activist arm of the conservative thinktank, gives Collins a 16% rating – one of its lowest – for conservative loyalty.

The daughter of a Maine state representative, Collins was the first woman to be nominated by a major party for governor of Maine in 1994. Two years after losing that race, she was elected to the US Senate, to which she was most recently re-elected in 2014. She is rumored to be eyeing the upcoming 2018 governor’s race in Maine.

Lisa Murkowski

The Alaska senator endured especially focused pressure from the Trump administration to support the health repeal. When she joined Collins to vote against bringing the skinny repeal to the floor, Trump attacked on Twitter.

Lisa Murkowski on her way to debate the healthcare bill. Photograph: Drew Angerer/Getty Images

“Senator @lisamurkowski of the Great State of Alaska really let the Republicans, and our country, down yesterday. Too bad!” he said.

However, Murkowski knows pressure. The Alaska native won a second term in the Senate after a successful write-in campaign – the only one since 1954.

The final push from the administration came Thursday in a phone call from the administration’s interior secretary, Ryan Zinke. Alaska’s other Republican senator, Dan Sullivan, told the Alaska Dispatch News that Zinke had delivered a “troubling message” about the administration’s support of Alaska.

Murkowski later told E&E News:“It was not a very pleasant call.” She said Zinke had described Trump as “really disappointed in what he perceives to be your lack of support for healthcare reform” and tried to convince her to vote yes.

While Murkowski publicly said he was working “in good faith” for the good of all, the New York Times reported her reaction as “furious”. Murkowski showed she is not a woman to be trifled with – as a subcommittee chair, she controls the interior department’s budget, and hearings for key appointments were suddenly rescheduled.

Alaskans have had one of the toughest times with healthcare. The very rural state has some of the nation’s highest monthly payments for health insurance – $904 per month for a mid-level plan. The state also has a high proportion of people on Medicaid, a health insurance program for the poor.