For seven years, it was one of the Republicans' most persistently stated promises: They would scrap Barack Obama's Affordable Care Act.
The law, popularly known as Obamacare, extended health coverage to 20 million Americans through a series of measures: Obliging companies to buy insurance plans for their employees; making insurance companies cover people with pre-existing conditions and allow people younger than the age of 26 to stay on their parents' plans; offering subsidies for people to buy insurance; and expanding Medicaid, a government-funded health care program for low-income people.
But the GOP complained it was an unacceptable intrusion of the federal government into the free market and it pushed up premium prices for some people who already had insurance.
Congressional Republicans repeatedly voted to kill all or part of the ACA (more than 60 times, according to one CNN tally) – symbolic actions as long as Mr. Obama could wield his veto from the White House. On the campaign trail, Donald Trump promised to demand an "immediate" repeal bill from Congress on "day one" of his presidency.
But now, after six months of complete control over the government – White House, Senate and the House of Representatives – the Republicans' repeal bill lies in tatters. What was supposed to be a rallying point for the party has instead turned into a messy, protracted internecine battle. Some of the blame will no doubt rest with the factionalism in the party. Right-wingers wanted the entire ACA repealed; moderates, however, balk at the idea of throwing millions of people off health insurance.
But much of it, political watchers say, falls squarely on Mr. Trump. The President made confusing and contradictory promises on health care (pledging that he would simultaneously repeal Obamacare, but somehow also ensure people didn't lose health insurance coverage, for instance) and didn't bother to lay out any specific directives on what the bill should look like.
"It was really quite extraordinary that such a major decision was ultimately delegated to Congress with no involvement from the President on the policy side," said Robert Shapiro, a political science professor at Columbia University in New York.
"On health care, he had no opinion. It wasn't clear what he wanted – he just wanted a victory."
Now, Mr. Trump may be staring down a major legislative defeat.
Act I. March 23, 2017: Freedom Caucus fail
Mr. Trump climbed into the cab of an 18-wheeler parked outside the White House, honked its horn and made a tough-guy face as he pretended to steer the rig down a highway. The President was trying hard that early-spring Thursday to show he was in the driver's seat – and not only during this trucking industry photo-op.
In a flurry of meetings at the White House and on Capitol Hill, the President, his aides and the party's congressional leadership worked frantically to broker an agreement between the factions of the party's House caucus to pass an Obamacare repeal bill, dubbed the American Health Care Act. Mr. Trump had left Speaker Paul Ryan to handle the drafting of the bill, and the Wisconsin congressman was having trouble getting enough votes to pass it.
The Freedom Caucus, a band of right-wing ideological purists led by North Carolina Congressman Mark Meadows, objected to the fact that the AHCA retained some Obamacare provisions, including the rules on insurance companies.
Mr. Trump hunkered down with the Caucus at the White House, but failed to win it over.
Later that evening, the President dispatched his budget chief, Mick Mulvaney, to tell the Republican caucus holed up in a basement of the Capitol that he was done negotiating. If a vote on the bill failed the next day, he would move on and leave Obamacare in place.
The hardball tactic didn't work. Shortly after noon the next day, Mr. Ryan visited the White House to tell Mr. Trump he still didn't have the votes.
They decided not to bring the bill to a vote after all.
Act II. May 4, 2017: Coming up roses
Six weeks later, the President stood in the White House Rose Garden, surrounded by the cheering GOP caucus. "We don't have to talk about this unbelievable victory," he said, as legislators applauded and laughed. "Wasn't it unbelievable?"
Earlier in the day, the AHCA had squeaked through the House by a 217 to 213 margin. Mr. Trump had finally won over hardliners with a provision allowing states to opt out of the rules on insurance companies. In a show of unity, Mr. Meadows stood just behind Mr. Ryan, looking out at the assembled reporters over the President's shoulder.
But not everyone in the GOP caucus was whooping it up: Fully 20 Republican Congresspeople had broken ranks with the President to vote against the AHCA.
Act III. July 17, 2017: Done like dinner
As far as Mondays go, it was pretty good. In the afternoon, Mr. Trump inspected an array of American-made goods piled up at the White House to highlight his promise to bring factories back to the country: He pretended to drive a fire truck, swung a baseball bat and tried on a Stetson.
That evening, the President tucked into a steak dinner with GOP senators as he looked to build support for the AHCA – now also referred to as the Better Care Reconciliation Act. Dessert, however, was anything but sweet: Senators Mike Lee and Jerry Moran, who were not at the meal, simultaneously announced they would not back the bill. Combined with previously announced defections by Kentucky's Rand Paul and Maine's Susan Collins, there was no way to move the proposal forward.
The BCRA was crushed between the party's two extremes. On the right flank, senators such as Mr. Lee argued the proposal didn't go far enough in rolling back subsidies or the taxes to pay for them. Moderates such as Ms. Collins were concerned about the consequences of cutting Medicaid. Majority Leader Mitch McConnell could not find a way to bridge this divide.
It likely didn't help that Mr. Trump himself described the legislation as "mean" in a meeting with senators, the Associated Press reported, and suggested it should be watered down.
The next act?
No one in Washington has any idea what happens now.
After Monday night's debacle, Mr. Trump and Mr. McConnell said they favour fully repealing Obamacare and figuring out a replacement for it later. "Republicans should just REPEAL failing ObamaCare now & work on a new Healthcare Plan that will start from a clean slate. Dems will join in!" the President tweeted.
But two days later, POTUS abruptly changed his mind. "I don't think we should leave town unless we have a health-insurance plan," he told a meeting with senators at the White House.
Capri Cafaro, a former Democratic minority leader in the Ohio state senate, said a straight repeal of Obamacare would be even less popular with senators than the BCRA. "Market instability would occur. States are having to budget, health care providers are having to budget," she said. "It would create chaos within the health-care system."
Dr. Shapiro, the political scientist, contends Mr. Trump's best move might actually be to work with some combination of Democrats and moderate Republicans on an improved version of Obamacare. After all, the little that the President has said about health policy – such as his characterization of the repeal bill as "mean," – suggests he is more inclined to a liberal view.
Most concerning for the GOP may be the fact that, during its long spell in opposition, it never sorted out how to fulfill such a major promise.
"They did not come in with a substantial plan," said Ms. Cafaro, now an executive in residence at American University in Washington. "You guys had seven years to come up with policy and nobody did."