Paul Ryan Paul Davis RyanAt indoor rally, Pence says election runs through Wisconsin Juan Williams: Breaking down the debates Peterson faces fight of his career in deep-red Minnesota district MORE won reelection as Speaker of the House on Tuesday in a near-unanimous vote that showcased a unified Republican Party dead set on dismantling the past eight years of the Obama administration.

Conservative Rep. Thomas Massie (R-Ky.), a frequent thorn in leadership's side, was the sole Republican to defect. Massie cast his vote for Rep. Daniel Webster (R-Fla.), who challenged Ryan for the Speaker's gavel in 2015 but backed the Wisconsin Republican this year.

“Americans vote for change and Congress votes for Paul Ryan?” Massie tweeted after the vote.

Americans vote for change and Congress votes for Paul Ryan? — Thomas Massie (@RepThomasMassie) January 3, 2017

On the Democratic side, Minority Leader Nancy Pelosi (Calif.) captured all but four of her party’s votes, despite Democrats’ Election Night shellacking.

The relatively small number of defections on both sides of the aisle suggests that Republicans and Democrats in Congress are digging in as a new and unpredictable Republican president, Donald Trump Donald John TrumpTrump says he doesn't think he could've done more to stop virus spread Conservative activist Lauren Witzke wins GOP Senate primary in Delaware Trump defends claim coronavirus will disappear, citing 'herd mentality' MORE, prepares to take office.

ADVERTISEMENT

The Speaker’s vote, kicking off the start of the 115th Congress, came as the parties prepare for battle over ObamaCare.

President Obama will head to Capitol Hill Wednesday to huddle with congressional Democrats to discuss ways to save his signature domestic legislative achievement. At the same time, Vice President-elect Mike Pence Michael (Mike) Richard PenceGOP short of votes on Trump's controversial Fed pick Pence seeks to boost Daines in critical Montana Senate race The Hill's Campaign Report: Trump's rally risk | Biden ramps up legal team | Biden hits Trump over climate policy MORE will rally Hill Republicans as they prepare to repeal Obamacare in the Trump administration’s first 100 days.

During Tuesday’s roll call, Ryan received 239 of the 241 possible Republican votes for Speaker, given that he didn’t vote. Pelosi got 189 votes, with four defections.

Rep. Jim Cooper (Tenn.), one of the last conservative Blue Dog Democrats standing, and Rep. Kathleen Rice (D-N.Y.) cast their votes for Rep. Tim Ryan (D-Ohio), who unsuccessfully challenged Pelosi in the caucus vote in November.

Rep. Ron Kind Ronald (Ron) James KindWisconsin Rep. Ron Kind wins primary Democrats exit briefing saying they fear elections under foreign threat Bottom line MORE (D-Wis.) voted for Cooper, while moderate Rep. Kyrsten Sinema (D-Ariz.) backed Rep. John Lewis (D-Ga.), the civil-rights icon.

The strong vote totals for Paul Ryan and Pelosi represented a remarkable turnaround for both House leaders.

Just a few months ago, Republicans were privately whispering that Ryan’s days as Speaker might be numbered, after he told his GOP colleagues he could neither defend nor campaign with Trump after the nominee was caught on tape speaking disparagingly about women. But Ryan’s fate changed when Trump shocked the political world and won the election, then said he wanted Ryan to stay put to help implement his agenda on the Hill.

Across the aisle, Pelosi was able to corral the overwhelming support of her caucus. The lopsided vote displayed the power of Pelosi to rally her members and highlighted Democrats' wish to form a united front in the face of the incoming Trump administration.

Weeks earlier, Tim Ryan had challenged Pelosi for the top leadership spot, gaining support from a third of the caucus in a closed-door, secret ballot vote. But Tuesday's public tally was an early sign that the Democrats are ready to put that fight behind them for the sake of taking on Trump and defending President Obama's legislative legacy from the Republicans vowing to dismantle those same achievements.

As he nominated Pelosi, Rep. Joseph Crowley of New York, the new Democratic Caucus chairman who briefly considered his own leadership challenge last year, lauded her as a political powerhouse who "will never be outworked, outmaneuvered or out-smarted."

He said a vote for Pelosi is "a vote to ensure that Congress does not undo" Obama's triumphs.

"We cannot turn back the clock," Crowley said.

The Democrats listened. Even most of those who had publicly supported Ryan last month quickly jumped on board to back Pelosi, including Reps. Seth Moulton (Mass.), Ruben Gallego (Ariz.), Beto O'Rourke (Texas) and Alcee Hastings (Fla.).

Pelosi's four defection were a stark improvement over the 19 she faced in 2011, after the Democrats lost 63 seats — and the House gavel. That GOP wave prompted former Rep. Heath Shuler (D-N.C.) to stage the only other challenge to Pelosi's 14-year reign atop the party. Only five of those 19 opposing Democrats remain in Congress, and several of them chose to back Pelosi this year, including Reps. Daniel Lipinski (D-Ill.) and Sanford Bishop (D-Ga.).

There was plenty of jousting and theatrical banter across the aisle as the votes were cast.

When a Republican made reference to Trump's "Make America Great Again" campaign slogan, Rep. Gerry Connolly Gerald (Gerry) Edward ConnollyHillicon Valley: Pentagon reaffirms decision to award JEDI contract to Microsoft | Schiff asks officials for briefing on election security threats Democrats explore new ways to resurrect election security briefings Bad blood between Pelosi, Meadows complicates coronavirus talks MORE (D-Va.) responded in kind.

"To keep America great, I vote for Nancy Pelosi," he said.

Read The Hill’s live coverage of the action here.