WASHINGTON -- In the most contentious confirmation vote yet, the Senate confirmed Betsy DeVos as President Trump’s secretary of education 51-50, with Vice President Mike Pence having to cast the tie-breaking vote.

Lawmakers voted 50-50 to confirm DeVos, which forced Pence to break the tie, making history as he became the first vice president to resolve a deadlocked vote on Cabinet nomination.

The vote came after Senate Democrats pulled an all-nighter, speaking out against DeVos on the Senate floor Monday into Tuesday.

Get Breaking News Delivered to Your Inbox

The Senate’s switchboard had been swamped by hundreds of thousands of phone calls concerning DeVos’ nomination, which also has held up the nomination of Sen. Jeff Sessions, R-Alabama, as attorney general because Republicans needed his vote.

Betsy DeVos, a wealthy Republican donor and longtime school choice advocate, has emerged as one of Trump’s most controversial Cabinet picks. Labor unions have bitterly contested DeVos’ nomination, fearing that she will destroy public education by promoting charter schools and publicly funded voucher programs for private schools. Civil rights activists also fear she will do little to advocate for LGBT students and children with special needs.

Trump stood behind his nominee, accusing Democrats of fighting progress and change.

“Senate Dems protest to keep the failed status quo,” Trump tweeted Tuesday before the vote. “Betsy DeVos is a reformer, and she is going to be a great Education Sec. for our kids!”

After an all-night speaking marathon by Democrats, Sen. Patty Murray of Washington state, the top Democrat on the Health, Education, Labor and Pensions Committee urged her Republican colleagues to vote against DeVos, calling her unqualified and saying that she will be a poor advocate for low income families and students with disabilities.

“We are just within one vote of sending this nomination back and asking the president to send us a nominee that can be supported by members on both sides of the aisle, that can set a vision that can fight for public schools, that can be that champion,” Murray said.

Senate Majority Leader Mitch McConnell said DeVos will seek to empower states, not federal bureaucrats, to make important education decisions.

“I know that she is committed to improving our education system so that every child - every child - has a brighter future,” McConnell said ahead of the vote.

Emotions ran high ahead of the vote as constituents jammed senators’ phone lines with calls and protesters gathered outside the Capitol, including one person in a grizzly bear costume to ridicule DeVos’ comment during her confirmation hearing that some schools might want guns to protect against grizzlies. Her opponents also charge that DeVos has no experience to run public schools, having never attended one or sent her children to a public school.

“I am not just voting no, I am voting no way,” Democratic Senator Chris Coons Delaware said on the Senate floor.

But Republicans accused Democrats of slow-walking DeVos and other qualified nominees to placate liberal base voters who still haven’t come to terms with Trump’s election.

“It seems this gridlock and opposition has far less to do with the nominees actually before us than the man who nominated them,” said Senate Majority Leader Mitch McConnell, R-Ky. “Enough is enough.”

In addition to DeVos, Republicans hope to confirm a series of other divisive nominees this week: Alabama Republican Sen. Jeff Sessions as attorney general, GOP Rep. Tom Price of Georgia as health secretary and financier Steven Mnuchin as treasury secretary.

In each case Democrats intend to use the maximum time allowed under the Senate’s arcane rules to debate the nominations, which may result in a late-night votes this week and delay Mnuchin’s approval until Saturday.

Republicans complain that previous presidents have been able to put their Cabinets in place more quickly. Democrats say it’s Trump’s fault because many of his nominees have complicated financial arrangements and ethical entanglements they claim they have not had enough time to dissect. Thus far, six Cabinet and high-level officials have been confirmed, including the secretaries of state, defense, homeland security and transportation.

The clash over nominees has created a toxic atmosphere in the Senate that mirrors the tense national mood since Trump’s election, with Democrats boycotting committee votes and Republicans unilaterally jamming nominees through committee without Democrats present. Yet there is little suspense about the final outcome on any of the nominees because Democrats themselves changed Senate rules when they were in the majority several years ago so that Cabinet nominees can now be approved with a simple majority, not the 60 votes previously required.