House Speaker Paul Ryan guaranteed a win on the Republican plan to dismantle Barack Obama's health care law. Instead, he suffered a brutal defeat, canceling a vote and admitting "we're going to be living with Obamacare for the foreseeable future."

Friday's painful rebuke is an ominous sign for President Donald Trump's agenda, from taxes to infrastructure to the budget. Looming in a few weeks is the need to agree on a bill to keep the government open. After the health care debacle, Trump told Republican leaders he's moving on.

The episode is a danger point for the relationship between Trump and Ryan, who had an awkward pairing during the campaign but worked in tandem on the GOP health measure.

"I like Speaker Ryan," Trump said. "I think Paul really worked hard."

Almost every congressional Republican won election while promising to repeal Obamacare. With a Republican in the White House, passage seemed almost guaranteed.

Ryan was steeped in the details, even at one point replicating for a nationwide cable news audience a detailed PowerPoint presentation he delivered to his members.

Earlier this month, he said flatly, "We'll have 218 (votes) when this thing comes to the floor, I can guarantee you that."

Ryan was thrust into the speaker's chair after the stunning 2015 resignation of John Boehner, R-Ohio, and a failed bid by Majority Leader Kevin McCarthy, R-Calif. At the time, Ryan held his dream job — chairman of the powerful, tax-writing Ways and Means Committee — but took the job as the last viable option to lead a fractured House GOP.

While Ryan eased comfortably into the job, he's not the schmoozer Boehner was, a key skill in delivering like-minded but reluctant lawmakers. He lacked the steel and seasoning of Democratic rival Nancy Pelosi, D-Calif., who delivered Obamacare in the first place — and that took months, not weeks.

Even before the bill went down, Pelosi was piling on, taunting Trump and, by implication, Ryan, for rushing the bill to the floor too early.

"You build your consensus in your caucus, and when you're ready, you set the date to bring it to the floor," Pelosi said. "Rookie's error, Donald Trump. You may be a great negotiator. Rookie's error for bringing this up on a day when clearly you're not ready."

Ryan entered the health care debate without the experience of having ever managed a situation of such magnitude.

"We were a 10-year opposition party where being against things was easy to do," a clearly disappointed Ryan said Friday. "And now, in three months' time, we've tried to go to a governing party, where we have to actually get ... people to agree with each other in how we do things."

During former President Barack Obama's tenure, Ryan had always been able to lean on Democrats to pass legislation Obama would sign.

On health care, however, Ryan could only count on Republicans, inheriting a fractious group that was schooled in opposing Obama, but lacking in the required team spirit to be a functioning, governing party.

It's a far different situation facing Ryan than he witnessed when joining the House in 1999. Then, Speaker Dennis Hastert, R-Ill., and legendary Whip Tom DeLay, R-Texas, ran the House with a five-vote majority, instilling a team spirit that is wholly lacking today. Ryan also lacks the tools available to prior leaders, like hometown earmarks.

"It's sometimes easier to do things with a smaller majority, because you all realize you've got to stick together or you won't get anything done," said Rep. Mike Simpson, R-Idaho. "When you get a bigger majority you have factions. And then the challenge is dealing with the different factions."

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

Ryan struggled — and failed — to thread the needle between conservative hardliners in the House Freedom Caucus and moderate lawmakers worried that the GOP measure would harm their constituents — and their political prospects in midterm elections that promise to be bruising for Republicans.

While Trump focused on winning over the Freedom Caucus, Ryan failed to keep more pragmatic lawmakers like Rep. David Young, R-Iowa, in line. When Young announced his opposition, a superPAC affiliated with Ryan, the Congressional Leadership Fund, announced it would pull its support from Young.

To be sure, several factors conspired against Ryan.

Trump sometimes sent mixed signals about how solidly he was behind the effort. The White House is short-handed and its staff is inexperienced in the art of legislating.

And Ryan's vote-counting team failed at basic tasks like keeping lawmakers, including the chairman of the powerful Appropriations Committee, Rodney Frelinghuysen, R-N.J., from issuing public statements promising to oppose the bill.

"We don't browbeat our folks," said Rep. Barry Loudermilk, R-Ga. "That's why it's harder to keep Republicans in line."

Ryan's stature appears secure. And even if Trump and his allies were upset with Ryan, there's no obvious replacement, given the party's short leadership roster.

"I don't think this will impact Speaker Ryan because everyone in our conference, whether you're voting yes or no, does know he put his heart and soul into this," said Rep. Chris Collins, a Trump ally. "I am certainly not blaming Paul Ryan in the least."

"He's highly respected. He worked very hard on this," said Rep. Tim Murphy, R-Pa. "He went in for the right reasons."