There are three branches of government, and two of them are in serious distress. What once passed for governing and leadership has become a spectacle of disservice by people who call themselves public servants.

The dramatic collapse of Republican efforts to change the Affordable Care Act provides Congress an opportunity to repair itself by returning to something approaching bipartisan lawmaking. It won’t be easily accomplished.

The executive branch has been a cauldron of turbulence. Just ask Anthony Scaramucci, the swaggering, newly named White House communications director, who predicted fewer than 48 hours ago what unexpectedly transpired late Friday afternoon: Reince Priebus, the White House chief of staff, was ousted.

The White House today has been a feuding, conniving band of officials vying for the affection of President Trump, who seems to encourage, even revel in, the chaos around him. Trump named John F. Kelly, the Homeland Security secretary, as chief of staff. The president called the retired Marine Corps general “a star.” But can he truly change the culture?

(Victoria Walker,Peter Stevenson/The Washington Post)

Washington hasn’t been working for some time; the breakdown began years ago. The dysfunction in Washington is one reason Trump was elected. But in the past six months, things have turned even worse, with the breakdown reaching new depths this week. For this, the Republicans and the president bear the responsibility.

[Senate rejects measure to partly repeal Affordable Care Act, dealing Trump and GOP leaders a major setback]

Until Sen. John McCain (R-Ariz.) cast the decisive vote on the bill for a “skinny repeal” of the ACA, the Senate was operating under procedures never seen before on a piece of major legislation. Legislating is never pretty — certainly passage of the Affordable Care Act was not — but there are norms usually respected by both sides. In recent weeks, those norms went out the window as Republicans struggled to fulfill a seven-year promise that is as internally divisive as it is elusive.

The effort was transparently cynical as Republicans grasped for something, anything, that might collect the 50 votes needed to keep alive what has proved to be their futile hope of getting rid of Obamacare. The measure from the House was dead on arrival in the Senate. Nothing cooked up behind closed doors under Senate Majority Leader Mitch McConnell (R-Ky.) worked, either.

In desperation, the Republican leaders turned to a vehicle that no serious member of Congress believed could work. Hours before the critical vote, Sen. Lindsey O. Graham (R-S.C.) correctly branded the skinny repeal for what it was. “The skinny bill as policy is a disaster,” he said. “The skinny bill as a replacement for Obamacare is a fraud.” Nonetheless, Graham voted for it on the pretext that it would keep the effort alive.

[‘Wait for the show’: High drama and low voices in a long, weird night at the Capitol]

McCain had joined Graham in lamenting the skinny bill’s deficiencies, and when the time came, he acted on his words. He had drawn criticism Tuesday when he returned to the Senate for the first time after being diagnosed with brain cancer and cast the deciding vote to begin debate on the bill.

(Bastien Inzaurralde/The Washington Post)

Congressional leaders are now left to pick up the pieces of a shattered and demoralizing process. What’s next no one can say. There will be angry words about the maverick from Arizona from some of his colleagues and from conservatives who have never trusted him. The president, who had disparaged McCain in the early days of his candidacy in 2015, has now felt the sting of payback.

“From the very beginning, it was clear that the fate of the Trump administration lay in the hands of the Senate Republicans,” Ross Baker, a political science professor at Rutgers University, said in an email Friday. “The Republican senators dutifully but often reluctantly did his bidding, but now they must come to the realization that he is not worthy of the loyalty he demanded.”

He went on to say, “With the debris of the Obamacare repeal effort still in view, the survivors need to regroup and rebuild armed with a set of bipartisan blueprints.”

[Enough about McCain. It was Collins, Murkowski and red-state Democrats who killed Trumpcare.]

There will be much talk about the need to work toward bipartisanship. There are examples: Congress just sent Trump, with overwhelming support from both parties, a tough sanctions bill aimed at Russia that puts the president on the spot. On health care and perhaps other upcoming issues, Republicans may have to swallow their pride to achieve successes. Democrats, who have had the luxury of claiming they want to work with Republicans without actually having to do so, will have to make good their words.

For seven years, Republicans have lived what turned out to be a fiction. They have many complaints about Obamacare. They have words that work in political ads and in their innumerable appearances before the cameras. But they have no solution. They may keep trying, but if they return to the scheming that got them to the moment of spectacular collapse early Friday, they will expose themselves once again to searing criticism.

At the other end of Pennsylvania Avenue, things are just as bad, though the departure of Priebus and the arrival of Kelly offers the possibility of a reset moment of the kind that now appears possible for Congress. Since Inauguration Day, the Trump administration has been rife with factionalism, built to be undisciplined by a president who lacks discipline. The boisterous arrival of Scaramucci, a New York financier and Trump loyalist, has managed in a single week to make things so much worse.

[White House tensions flare in the open as Scaramucci rips Priebus in vulgar tirade]

Scaramucci’s expletive-filled rant to the New Yorker’s Ryan Lizza took all the backroom maneuvering and senior-level backstabbing and put it on full public display. His attacks on Priebus and chief strategist Stephen K. Bannon left little room for reconciliation. His broader threats show a lack of true understanding of how government works.

Scaramucci tried to wash away his remarks by claiming that he sometimes uses “colorful” language and that he will try to do better. What he doesn’t understand is that it was more than the words that shocked; it was the attitude and the posture he struck and has struck since being named to the White House staff.

Max Stier, president and chief executive of the Partnership for Public Service, said there are many inadequacies in the executive branch that predate Trump, including some caused by congressional inaction.

“It’s important not to put it all on his plate. These are things that predated him but are getting worse under his tenure,” Stier said. Trump is trying to use the model he followed as a businessman and developer, a model not suited to running the federal government, Stier said. “It appears as if everything is being run through one small pipe,” he said. “President Trump and set of decision-makers are trying to address everything of importance in the federal government themselves. . . . So far, it doesn’t seem to me they are learning the right lessons.”

The White House can’t continue to operate this way, at least not in the true interests of the country or even those of Trump’s core supporters. In just a week, the president has made it almost untenable for Attorney General Jeff Sessions to stay in the job, drawing concerns that Trump’s ultimate target is Robert S. Mueller III, the special counsel charged with investigating possible links between the Trump campaign and Russia.

This was not the fault of the chief of staff. It is illustrative of the problem that now falls into Kelly’s lap.

The problem of dysfunction extends to other parts of the executive branch. Interior Secretary Ryan Zinke threatened Republican Sens. Lisa Murkowski and Dan Sullivan of Alaska by implying that Murkowski’s vote not to proceed with debate on health care could jeopardize federal support for the state, according to the Alaska Dispatch News.

The State Department, by every account, is not functioning well under Secretary Rex Tillerson. The reaction to Trump’s transgender military ban shows that the relationship between the White House and the Defense Department is tense. Politico’s Susan Glasser reported that the national security apparatus under H.R. McMaster is not running smoothly and that Trump is not happy about it.

Congress will soon depart for its annual August recess. Trump and Republican lawmakers had hoped to arrive at the summer break with a record of accomplishment, at the least with a significant down payment on the promises of the 2016 campaign. Instead, they face the bleak prospect of knowing that they have failed on their signature pledge on health care, that other legislative business remains unfinished and that the White House faces uncertain days.

The president has kept one big promise, which was to disrupt the capital. But it has not worked out quite like he and the Republicans expected.