Republicans re-elect Paul Ryan as Speaker of the House

Leigh Ann Caldwell and Alex Moe
Paul Ryan: Trump will be a very successful president

House Republicans have unanimously re-elected Rep. Paul Ryan to be speaker of the House.

Ryan's post as the top ranking member of Congress was being contested as recently as ten days ago, but after Donald Trump won the presidency, Republicans united behind him.

Rep. Chris Collins of New York, who was the first House member to back Trump for president, gave one of the nominating speeches on Ryan's behalf in the closed-door session of GOP members Tuesday afternoon.

Trump and Ryan were not particularly close during the election. Just before Election Day, members openly questioned Ryan's effectiveness in the role of speaker, but they emerged from a meeting Monday supporting the Wisconsin Republican, saying he would face no challengers for the post.

More from NBC News:
House Democrats delay leadership elections for party soul-searching
Some House Republicans stick by Trump's choice of Steve Bannon
Repeal Obamacare? Maybe not, says Trump

One of those members who had initial misgivings about supporting Ryan was Rep. Mark Meadows of North Carolina, a member of the conservative Freedom Caucus. He had threatened a challenge to Ryan just days before the election, but had a different opinion when Congress returned to Washington this week.

"To suggest that President-elect Trump's victory didn't weigh as a factor in terms of the speaker's race would be disingenuous to suggest otherwise," Meadows said.

Meadows said he likes the path Ryan is pushing forward, including the repeal and replacement of the Affordable Care Act, also known as Obamacare.

Rep. Tom Cole of Oklahoma agreed that Trump's victory helped to unite the party and stave off a GOP civil war that had been anticipated during the campaign when some elements of the party openly opposed Trump and others, including Ryan, offered tepid support.

"Victory heals all wounds," Cole said.

Ryan rose to the role of speaker after the previous leader of the House, Rep. John Boehner, stepped down more than a year ago. Ryan, seen as a pragmatist who can unite different factions of the party, was widely recruited despite his hesitation to take on the demanding role.

But the ascension of Trump posed challenges for Ryan, who disagrees with the nominee on both policy -- including trade, entitlements and government spending -- and style.

But the party lost fewer House seats than expected seats this cycle, bolstering Ryan, a talented fundraiser who raised money for members of all factions of his party - even the most conservative who are most likely to agitate against him.

With the Republican Party now in control of the House, the Senate and the presidency, GOP House members who are looking for an aggressive agenda are optimistic for the next two years.

Democrats, meanwhile, have delayed their leadership elections as their caucus is looking to re-evaluate after a stinging defeat.

The incoming House will formally vote on speaker in January.