WASHINGTON — President Donald Trump’s choice of billionaire Betsy DeVos to be education secretary was confirmed by the Senate on Tuesday, but only after Vice President Mike Pence was called in to break a tie that threatened to defeat her.

The tie-breaking vote, which Senate officials said was unprecedented to confirm a Cabinet nominee, followed an all-night debate on DeVos as Senate Democrats tried to pressure at least one more Republican to oppose her and defeat the nomination.

Only two Republicans joined the 46 Democrats and two independents in opposition to DeVos. Critics have called her unprepared to lead the Department of Education after a rocky Senate confirmation hearing.

Republican Sens. Susan Collins of Maine and Lisa Murkowski of Alaska joined the Democrats and two independents in opposition to DeVos. That left 50 Republicans supporting her in the 100-member chamber.

Maine’s other senator, independent Angus King, voted against DeVos’ nomination. In a statement after the vote he said, “After following her confirmation hearing closely and after a great deal of consideration, last month I concluded that I could not support Ms. DeVos because I was concerned that she wouldn’t be a strong advocate for public education, that she lacked the necessary knowledge to lead the Department, and indeed, that she was hostile to the fundamental mission of the Department.

“I continue to harbor those concerns, and in light of her confirmation, now consider it my responsibility to fight to ensure that, under her leadership, Maine public schools will be provided adequate and appropriate funding and that Maine students will be guaranteed an equal opportunity to a quality education.”

Senate Democratic leader Chuck Schumer immediately derided the proceeding.

“This cabinet nom is so unqualified, so divisive, that @MikePenceVP had to drive down Pennsylvania Ave to cast the deciding vote,” he wrote in a Twitter post after the vote.

Under the U.S. Constitution, the vice president also serves as president of the Senate, with the power to cast votes only when there are ties on nominations or legislation.

Republican Trump tweeted his congratulations to the nominee and Pence praised her. “Today’s vote to confirm Education Secretary @BetsyDeVos was a vote for every child having a chance at a world-class education,” the vice president wrote in a Twitter post.

Historically, Cabinet nominees with weak support in the Senate ask the president to withdraw their nomination, which DeVos did not do.

DeVos is married to the heir and former chief executive of Amway, which sells household and personal care items. She is also the daughter of the founders of Prince Corp., a Michigan car parts supplier, and sister of Erik Prince, the founder of the security company formerly known as Blackwater USA, now called Academi.

As Monday night’s debate wound down, Schumer said of DeVos, “She disdains public education where 90 percent of our students are.”

Senate Majority Leader Mitch McConnell, urging her confirmation, said it was time to “end the unprecedented delay by Democrats” on the Cabinet nominations by Trump.

DeVos has been an advocate of charter schools, which operate independently of school districts and frequently are run by corporations. Democrats are concerned she will promote charter schools in a way that would undercut public schools, which have long been the anchor of the U.S. education system.

Teachers unions, a major constituency for the Democratic Party, roundly opposed DeVos, a philanthropist and investor, to lead the department, which sets education policy for younger children and universities and administers a college financial aid program of $1 trillion.

The Consumer Federation of America urged DeVos to confront the problem of millions of Americans in default on student loans. “The new secretary needs to put borrowers and taxpayers first, rather than focusing on helping the student loan and for-profit college industries pump up their profits,” it said.

After the cliffhanger vote on DeVos, the Senate promptly limited debate on Trump’s choice of Sen. Jeff Sessions to be attorney general. A final vote on Sessions’ nomination is expected sometime this week.

Also up for Senate debate soon are Trump’s nominations of Rep. Tom Price to be secretary of Health and Human Services and ex-banker Steve Mnuchin to be Treasury secretary.

All three face opposition from Senate Democrats.

Also facing a rough ride is Trump’s choice of Andrew Puzder to be secretary of labor. Puzder, the chief executive of CKE Restaurants Inc., has admitted to employing an undocumented immigrant as a house cleaner.