The House’s failure on Friday to even vote on a Republican bill to repeal Obamacare — something party leaders promised for seven years and President Trump campaigned on — was a huge defeat for Trump and the GOP, in a number of ways.

It showed that Republicans — now in control of the House, the Senate and the presidency — couldn’t band together on a major priority. It suggests that the divides among Republicans, a theme of the Obama years, remain a problem for the party. In fact, those divides could be even wider in the Trump era: In the health care debate, not only did the deeply conservative House Freedom Caucus break with party leadership, as it often has (arguing the legislation was not conservative enough), but a bloc of more centrist members emerged from the other side of the political spectrum, arguing that the bill was too conservative. And Trump, who has cast himself as a master negotiator, couldn’t get fellow Republicans behind him, making him look ineffectual in comparison to his three predecessors as president, who all got their first legislative priority through Congress in their first year in office.

So what happened? And what does the bill’s failure portend for Trump’s other agenda items?

Why the health care push fell apart

While there was not a vote, the American Health Care Act failed because of a coalition of Republicans that was both ideologically and geographically diverse. The representatives wary of voting for the AHCA, which reached about 50 in number by week’s end, according to The Washington Post — more than double the 22 GOP votes the party could afford to lose — included members from deeply conservative districts where Trump won overwhelmingly but also areas where he lost. The list of potential “no” votes included veteran members, such as 64-year-old Ileana Ros-Lehtinen, whose district includes parts of Miami, but also 36-year-old Justin Amash of Michigan. There were Northeastern moderates, Southerners and a strong Midwestern contingent, as well.

Broadly, there were four blocs of GOP members opposed to the legislation: those from the conservative and anti-establishment House Freedom Caucus; those in districts that Hillary Clinton won or almost won in 2016, putting them in some political peril if they backed a bill that is very unpopular; those associated with the Tuesday Group of more centrist House Republicans; and a few who are kind of mavericks, sometimes voting against the position of GOP congressional leaders and Trump. But there were some “no’s” outside of those four blocs, and many members within those four blocs who said that they supported the AHCA. (Some members fall into in more than one of these groups.)

House Freedom Caucus (22 potential “no” votes of about 30 members):

Justin Amash (Michigan) Rod Blum (Iowa) David Brat (Virginia) Mo Brooks (Alabama) Ken Buck (Colorado) Warren Davidson (Ohio) Scott DesJarlais (Tennessee) Jeff Duncan (South Carolina) Ron DeSantis (Florida) Thomas Garrett (Virginia) Paul Gosar (Arizona) Trent Franks (Arizona) Jody Hice (Georgia) Jim Jordan (Ohio) Raul Labrador (Idaho) Mark Meadows (North Carolina) Steve Pearce (New Mexico) Scott Perry (Pennsylvania) Bill Posey (Florida) Mark Sanford (South Carolina) Randy Weber (Texas) Ted Yoho (Florida)

Republicans associated with Tuesday Group (13 of about 50 members):

Ryan Costello (Pennsylvania) Carlos Curbelo (Florida) Charlie Dent (Pennsylvania) Mario Diaz-Balart (Florida) Daniel Donovan (New York) Rodney Frelinghuysen (New Jersey) Jaime Herrera Beutler (Washington) David Joyce (Ohio) John Katko (New York) Leonard Lance (New Jersey) Frank LoBiondo (New Jersey) Patrick Meehan (Pennsylvania) Ileana Ros-Lehtinen (Florida)

Republicans in districts Hillary Clinton won (9 of 23 members):

Barbara Comstock (Virginia) Ryan Costello (Pennsylvania) Carlos Curbelo (Florida) Will Hurd (Texas) John Katko (New York) Leonard Lance (New Jersey) Patrick Meehan (Pennsylvania) Ileana Ros-Lehtinen (Florida) Kevin Yoder (Kansas)

Mavericks (9 of 11):

Justin Amash (Michigan) Andy Biggs (Arizona) Louie Gohmert (Texas) Walter Jones (North Carolina) Raul Labrador (Idaho) Thomas Massie (Kentucky) Mark Sanford (South Carolina) Christopher Smith (New Jersey) Don Young (Alaska)

Other potential “no” votes:

Ted Budd (North Carolina) Rick Crawford (Arkansas) Brian Fitzpatrick (Pennsylvania) Daniel Webster (Florida) Rob Wittman (Virginia) David Young (Iowa)

In one sense, Republicans and Trump not coming together on health care was not surprising. It is a very complicated issue, one that bedeviled Bill Clinton and almost Barack Obama as well. But the collapse of the bill illustrated something broader: The Republicans, in seven years, hadn’t reached agreement in terms of health policy on much beyond hating the Affordable Care Act.

The good news for Trump: He can move on

With this defeat, Trump avoids two potentially negative outcomes: getting mired in the details of health care policy for months and months, as he and the congressional Republicans try to write a bill the party can agree on; and secondly, dealing with the political fallout of pushing through an unpopular bill. Former President Barack Obama signed the Affordable Care Act into law on March 23, 2010, after spending close to a year working on it. And the ACA vote was a major factor in Democrats losing a bunch of congressional seats in the midterm elections later that year.

Now, Trump has an extra year of his presidency in which he won’t be working on a large complicated health care bill. And Republican members of Congress won’t have to defend the AHCA on the campaign trail.

Other parts of Trump’s agenda, such as rolling back Obama-era regulations and appointing more conservative-leaning judges to the Supreme Court and other federal courts, are strongly supported by Republicans on Capitol Hill and may be easier to get through.

The bad news for Trump: Fissures in his party may be about more than health care

During the last two years of Obama’s presidency, the House Freedom Caucus was a huge challenge for fellow Republicans. It constantly fought with then-House Speaker John Boehner — over policy and tactics — and Boehner eventually stepped down after regularly expressing frustration with the more conservative members of the House.

With a Republican in the White House, some in the party hoped that the Freedom Caucus would play nice (or, at least, nicer). The fight over the AHCA suggests otherwise. Nearly half of the Republican opposition to the AHCA (22of the roughly 50 members in opposition) came from the Freedom Caucus, which argued the bill was insufficiently conservative and was not swayed by Trump’s lobbying.

The health care vote also revealed a divide between the House and the Senate. The AHCA, crafted by Speaker Paul Ryan and other House GOP leaders, faced strong criticism from Republican senators, particularly Tom Cotton of Arkansas and Rand Paul of Kentucky.

And Cotton’s opposition portends problems for the president’s next push: a major tax reform bill. Ryan is calling for legislation that would overhaul tax policy by essentially taxing goods imported to the U.S. at a higher rate but removing taxes on exports. Cotton has already blasted the idea, which is opposed by Wal-Mart, which buys lots of imported goods and is based in Arkansas.

Finally, the unsuccessful scramble to pass the AHCA raises the possibility that Trump’s talents work better on the campaign trail or in the business world than in the West Wing. None of his negotiating moves worked. In meetings with members of Congress, he bluntly called out those who were not yet behind the bill, an intimidating approach that presidents often avoid. He tried to negotiate the details of the bill with the Freedom Caucus, while also using his Twitter feed to pressure them.

The Freedom Caucus was unmoved.

Trump, as he told a Time Magazine reporter in an interview this week, before the AHCA failure, “can’t be doing so badly, because I’m president, and you’re not.”

But the health care debacle suggests that, at least right now, Trump is far from being an effective president. His top legislative priority died on Capitol Hill, more voters disapprove than approve of his job performance, and congressional committees and the FBI are investigating if his allies colluded with the Russians to help Trump win the presidential election.

CORRECTION (March 25, 11:35 a.m.): An earlier version of this article incorrectly listed U.S. Rep. John Duncan of Tennessee as a likely opponent of the American Health Care Act. He was not. It also incorrectly described how Rep. Rodney Frelinghuysen’s New Jersey district voted in 2016. Donald Trump carried the 11th Congressional District in New Jersey, not Hillary Clinton. The numbers of Republicans in each of the four blocs identified above have been updated accordingly.