January 3, 2017 5:00 PM, EST

Paul Ryan Re-Elected Speaker of the House

Nancy Pelosi, Paul Ryan by Andrew Harrer/Bloomberg News

Paul Ryan was formally re-elected House speaker Jan. 3 as he intensifies his efforts to move past his differences with Donald Trump after a divisive campaign.

But Ryan’s victory was marred by controversy over a last-minute effort by Republicans to weaken the independent congressional ethics office, a reminder of the splits within the new Republican majority. Trump blasted Republicans for prioritizing the ethics change, leaving the caucus to reverse itself moments before formally opening the 115th Congress.

Ryan won resounding re-election with 239 votes — clearing the 218 needed — with only one Republican voting for someone else. But his relationship with the incoming president will face a test as he carves out his own agenda for Republicans in Congress.

CAPITOL AGENDA: Tunneling out of infrastructure mess

“This is a once-in-a-lifetime opportunity. This is the kind of thing that most of us only dream about. I know — because I used to dream about it. The people have given us unified government,” Ryan told House members after his re-election.

But the speaker faces competing pressures from different parts of his own caucus. Some members warn they’ll be monitoring his loyalty to Trump. Other senior members want Ryan to stick to the conservative line on spending and other matters and not roll over for Trump, a stance that could bring a quick end to the uneasy peace between the speaker and the new president.

The two men see eye to eye on repealing Obamacare as the first order of business, but they don’t agree yet on the details of how to replace it. Other early flashpoints are likely to be Trump’s insistence on a $1 trillion infrastructure plan and a wall along the Mexican border — both of which could balloon the deficit, anathema to a spending hawk like Ryan. 

During the campaign, Ryan poked fun at Trump’s big-dollar infrastructure spending proposal, saying it wasn’t part of the House Republican "Better Way" agenda. Since Trump’s election, Ryan has been sounding a different tune, saying they’ll figure it out.

"This speaker is not a potted plant, and he has strong opinions on matters of policy," said Rep. Charlie Dent of Pennsylvania, a Ryan ally and co-leader of a group of House moderates. He said Ryan will work with the Trump administration, "but I just don’t see the speaker rolling over on every policy."

The Wisconsin Republican has emerged unscathed so far from his unprecedented decision last fall to distance himself from the then-Republican presidential nominee. Trump isn’t retaliating yet, but it’s uncertain whether their tentative truce can last.

Even with full Republican control of Congress and the presidency, some conservatives warn that Ryan, 46, will be on a short leash. Trump has strong support within the House GOP conference, and the speaker must tread lightly because it was the president-elect’s Republican uprising that succeeded, not his own.

And while Trump may not be perfectly meshed with the policy thinking of the most conservative House Republicans, many of them are kindred spirits in his anti-establishment, change-Washington bent.