Senators rallied in the dark, pulled graveyard shifts on the empty chamber floor and manned phones in the Capitol as switchboards lit up with calls.

In the end, neither a fierce push by grassroots activists nor the 24-hour talkathon staged by Senate Democrats could stop Betsy DeVos from becoming Secretary of Education.

DeVos was confirmed Tuesday afternoon by the slimmest of margins: 51-50, with Vice President Mike Pence casting the tie-breaking vote in his capacity as President of the Senate. It was the first time in U.S. history that a Vice President has been called upon to resolve a deadlock over a Cabinet nomination.

The confirmation of DeVos, an outspoken supporter of school voucher programs, was a bitter blow for Democrats after a campaign driven by progressive advocacy groups, marked by millions of phone calls, emails and tweets and capped by a marathon parade of overnight speeches on the Senate floor.

But the rebellion was probably doomed from the beginning. Despite the tide of grassroots energy, the Democrats did not have the votes. And the outcome may become a familiar one during the first two years of Donald Trump’s presidency, as the minority party faces heightened pressure to block Trump’s agenda while confronting the limits of its power within the Capitol.

Only a handful of Cabinet nominees have been rejected in the Senate over the past two centuries; the last was in 1989, when John Tower was denied the post of Defense Secretary amid allegations of alcohol abuse and womanizing as well as scrutiny of his ties to defense contractors. (Other nominees since then have been withdrawn under political pressure.) In the past, relatively minor Cabinet nominations have almost always earned bipartisan support and scant attention from the public. In the nearly four decades since Congress elevated the Education secretary to a Cabinet-level position, there has never been a similar stand-off over a president’s nominee. Even President Ronald Reagan’s second-term pick, William J. Bennett, who had strong roots in the Christian right and needled liberals with his opposition to causes like bilingual education, was confirmed with bipartisan support.

Yet Democrats homed in on DeVos as one of the more vulnerable nominees and a potent symbol of what many progressives saw as a wealthy, inexperienced president appointing wealthy, inexperienced friends to his Cabinet. DeVos, a billionaire philanthropist from Michigan, has no experience either working in, or attending, public schools, which she once dismissed as a “dead end.” Both she and her children attended private Christian academies.

When DeVos struggled during her confirmation hearing Jan. 17 to answer rudimentary questions about education policy and appeared unfamiliar with critical laws like the Individuals with Disabilities Education Act, Democrats tasted blood. “She is the least-qualified nominee in a historically unqualified Cabinet,” declared Senate Democratic leader Chuck Schumer.

Eli Broad, another billionaire philanthropist with deep ties in the education world, wrote in a letter to senators that DeVos’s performance at the hearing reinforced his doubts about her competence. “Before Mrs. DeVos’s hearing, I had serious concerns about her support for unregulated charter schools and vouchers as well as the potential conflicts of interest she might bring to the job,” Broad wrote. “Her testimony not only reinforced my concerns but also added to them.” Late-night comedians and Saturday Night Live actress Kate McKinnon later mocked some of DeVos’s more cringeworthy gaffes, including her suggestion that guns ought to be allowed in schools to protect against “potential grizzlies.”

Yet DeVos had the unwavering support of nearly all Senate Republicans, as well as crucial members of the staid educational establishment. Former Florida Gov. Jeb Bush, who heads the Foundation for Excellence in Education, told reporters DeVos was an “extraordinary choice” to head the Education Department. Margaret Spellings, who served as Education Secretary under former President George W. Bush, described the nominee as an “honest leader” and “dedicated advocate” for children. “She’s a good pick,” Spellings told TIME.

DeVos carved out a name for herself in the last 25 years as a powerful educational philanthropist, giving tens of millions of dollars to underwrite state-based initiatives allowing taxpayer dollars to fund private or religious schools. The Michigan billionaire, who is an heiress to the Amway fortune, also poured millions of her family’s money into efforts to increase the reach of charter schools, which are publicly funded but privately run institutions. A former Republican Party chairwoman in her home state, DeVos was instrumental in backing the controversial expansion of for-profit charter schools and blocking legislation designed to oversee those institutions.

Many of the Republicans tasked with considering her nomination have been direct beneficiaries of DeVos’s largesse. According to financial disclosures released by the Senate Education Committee, DeVos has contributed just under $5.3 million since 2011 to personal political campaigns, including to 17 U.S. Senators, four of whom sit on the committee that reviewed her nomination. She gave $7,800 to Sen. Bill Cassidy, a Republican from Louisiana; $5,400 to Alaska Republican Lisa Murkowski; $5,400 to Todd Young, a Republican from Indiana; and $7,400 to Tim Scott, a Republican from South Carolina. DeVos also gave $300,000 to the GOP’s Senate Leadership fund, $114,200 to the National Republican Senate Committee, $215,000 to the Republican National Committee and $160,000 to the Senate Republican Campaign Committee.

Democrats pointed to DeVos’s vast political contributions as a clear conflict of interest. And while the GOP denied the charge, DeVos herself has been more sanguine in the past. In a 1997 op-ed in the Capitol Hill paper Roll Call, DeVos wrote that she has “decided to stop taking offense at the suggestion” that political donations are an attempt at “buying influence.”

“Now I simply concede the point,” she wrote. “They are right. We do expect something in return. We expect to foster a conservative governing philosophy consisting of limited government and respect for traditional American virtues. We expect a return on our investment.”

The combination of DeVos’s convictions, political connections and her poor performance under Senate questioning prompted a furious grassroots effort to defeat her nomination. Powerful advocacy groups like the American Federation of Teachers helped organize a campaign to #DumpDeVos, as they put it on Twitter. Grassroots teachers’ groups like the Badass Teachers Association canvassed supporters, urging them to call their representatives and lobby wavering Senators. Millions of calls flooded Capitol offices.

“The last three days have been the BUSIEST IN CAPITOL SWITCHBOARD HISTORY,” tweeted Democratic Sen. Brian Schatz of Hawaii. “By almost double. This is working.”

Not well enough. Despite their best efforts, Democrats were able to peel off just two Republicans: Murkowski and Maine Senator Susan Collins, both moderate lawmakers who said their constituents expressed concerns about DeVos’s voucher policies would impact education in their largely rural states.

At the same time, the dramatic bid to defeat DeVos signals that Democrats may be rethinking their approach to dealing with Trump. Before he took office, some Democratic leaders suggested the party would not take a page from the Republican playbook and reflexively oppose every action by the new President. That may be changing. The opening weeks of Trump’s presidency have been punctuated by protests, with millions of demonstrators flooding cities around the U.S. in opposition to his policies. The tide of grassroots activism now looks set to tug the party to the left, much as the Tea Party pulled the GOP to the right during the Obama years. Legislators in the Capitol will be pressured to adopt a more confrontational approach.

And while Democrats took a unified line against DeVos, the caucus may not hold together during future battles. Ten Senate Democrats are up for re-election in 2018 in states Trump won. Those members will need to pick their battles carefully, knowing that each vote they make might wind up the subject of a GOP ad campaign.

The battle over DeVos’s nomination was the first test of this burgeoning liberal resistance movement. The outcome may foreshadow the frustration to come.

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Alex Altman at alex_altman@timemagazine.com and Haley Sweetland Edwards at haley.edwards@time.com.