WASHINGTON — The Senate confirmed Betsy DeVos on Tuesday as education secretary, approving the embattled nominee only with the help of a historic tiebreaking vote from Vice President Mike Pence.

The 51-to-50 vote elevates Ms. DeVos — a wealthy donor from Michigan who has devoted much of her life to expanding educational choice through charter schools and vouchers, but has limited experience with the public school system — to be steward of the nation’s schools.

Two Republicans voted against Ms. DeVos’s confirmation, a sign that some members of President Trump’s party are willing to go against him, possibly foreshadowing difficulty on some of the president’s more contentious legislative priorities.

The Run-Up

The podcast that makes sense of the most delirious stretch of the 2016 campaign.

It was the first time that a vice president has been summoned to the Capitol to break a tie on a cabinet nomination, according to the Senate historian. Taking the gavel as the vote deadlocked at 50-50, Mr. Pence, a former member of the House, declared his vote for Ms. DeVos before announcing that Mr. Trump’s nominee for education secretary had been confirmed.

The two Republicans who voted against the nominee, Senators Susan Collins of Maine and Lisa Murkowski of Alaska, announced their opposition to her last week. In back-to-back floor speeches, the lawmakers said Ms. DeVos was unqualified because of a lack of familiarity with public schools and with laws meant to protect students, despite her passion for helping them.

Ms. Collins and Ms. Murkowski said they had also been influenced by the thousands of messages they had received urging them to reject the nomination.

Interactive Feature | How Senators Voted on Devos The Senate voted to confirm Betsy DeVos as education secretary.

Despite clamorous objections to Ms. DeVos from teachers’ unions and even some charter organizations that typically oppose them, opponents nonetheless fell shy of defeating her nomination. Most Republicans described her as committed and determined to put what is best for children above all else.

In a fiery speech moments before the vote, Senator Lamar Alexander, Republican of Tennessee and a former education secretary himself, criticized his Democratic colleagues for opposing Ms. DeVos, accusing them of opposing her because she was appointed by a Republican president.

Mr. Alexander, chairman of the committee that approved Ms. DeVos’s nomination last week in a straight, party-line split, said she had been “at the forefront” of education reform for decades. “She led the most effective public school reform movement over the last few years,” he said.

Lacking the votes to block Ms. DeVos, Democrats realized there was little they could do. Having exhausted every legislative option to slow consideration of her nomination, Democrats held vigil in the final 24 hours before her confirmation vote, coming to the Senate floor throughout the night and into the morning to reiterate their objections.

And though they spoke mostly to a chamber empty but for a handful of clerks, pages and other staff members, Democrats pressed their absent Republican colleagues to join them, hoping for an eleventh-hour defection that would derail Ms. DeVos’s nomination.

Senator Patty Murray of Washington, the top Democrat on the committee that approved Ms. DeVos — and a former educator herself — on Tuesday morning urged disheartened colleagues and advocates not to think of their efforts as a waste.

“It’s made an impact here and made a difference,” she said. “And I think it’s woken each of us up in this country to what we value and what we want.”

Ms. DeVos has focused on expanding parental choice in education and embracing charter schools, but also on vouchers that can allow students to use taxpayer dollars to pay tuition at private, religious and for-profit schools. Her ideology was a good fit for the education platform that Mr. Trump put forward during the campaign, which called for a $20 billion voucher initiative aimed at low-income children.

But freeing such an enormous sum would most likely require the reallocation of existing federal education money, as well as a realignment of congressional priorities. Vouchers were not part of a sweeping education overhaul passed in 2015, and lawmakers from rural areas, where schools tend to be farther apart, are particularly wary of school choice initiatives.

The Trump administration could potentially advance a more limited voucher program and seek tax credits for private school tuition or home-schooling costs.

Ms. DeVos has also indicated that she would dismantle other pieces of the Obama administration’s legacy, potentially including a rule that denies federal student aid money to for-profit colleges whose graduates struggle to get jobs, as well as an aggressive effort to investigate and adjudicate campus sexual assault claims.

While they may have lost the fight against her confirmation, many advocates said they would continue to fight Ms. DeVos as she serves as education secretary. Some vowed to demonstrate at her public appearances at forums and schools and to seek public candidates friendly to their view to run for local office.

Lily Eskelsen García, president of the National Education Association, said her union would tap into the vast database of advocates it had built during Ms. DeVos’s confirmation process to help keep her in check. “As soon as she does something alarming, it will be known, it will be seen,” she said. “She won’t be able to hide.”

Mr. Trump’s choice of Ms. DeVos to lead the Department of Education, the smallest of the cabinet agencies, presented senators with a multitude of potential pitfalls. Her background as a prolific Republican fund-raiser who has donated about $200 million over the years to Republican causes and candidates — including some senators, as has been the case for previous presidential nominees — came under scrutiny.

Interactive Feature | Get the Morning Briefing by Email What you need to know to start your day, delivered to your inbox Monday through Friday.

Ms. DeVos is the daughter of a wealthy family, and her husband, Dick, is the heir to the Amway fortune. Her complex web of financial investments also raised red flags among critics. Ms. DeVos was the first of Mr. Trump’s nominees not to complete an ethics review before appearing before senators.

Democrats have also expressed concern about her family’s contributions to groups that support so-called conversion therapy for gay people and her past statements that government “sucks” and that public schools are a “dead end.” Opponents have also focused on the poor performance of charter schools in Detroit, which she championed.

Senators and education advocates from both sides of the aisle also expressed alarm after Ms. DeVos, during her Jan. 17 confirmation hearing, confused core responsibilities of the Department of Education.

In one notable exchange that spread across the internet, Senator Tim Kaine, Democrat of Virginia, asked Ms. DeVos whether all schools that receive public money should have to follow the requirements of the Individuals with Disabilities Education Act, the landmark 1975 civil rights legislation. Under that federal law, states and school districts are required to provide special education services to children with disabilities.

Ms. DeVos said the issue was “best left to the states.”

“It was the most embarrassing confirmation hearing that I have ever seen,” Senator Al Franken, Democrat of Minnesota, said before the vote Tuesday. He demanded that Republicans explain how they could still support her.

“If we cannot set aside party loyalty long enough to perform the essential duty of vetting the president’s nominees, what are we even doing here?” Mr. Franken asked.

In a final push that included demonstrations around the country, constituents and advocates swamped Senate offices with calls and missives, so inundating the Capitol switchboard that it disrupted the Senate’s voice mail system.