The week had almost ended when the Twitter item came across. Minutes before quitting time, less than an hour after the markets closed: Gen. John Kelly named White House chief of staff.

The secretary of homeland security was replacing Reince Priebus at 1600 Pennsylvania Avenue.

After about six months and a week, the former chairman of the Republican National Committee had been removed as the No. 1 aide to President Trump.

For some among Trump's legions of loyalists, this may be a shock. Priebus was the ultimate symbol of the GOP's establishment bowing to the populist billionaire from Fifth Avenue. He was the man who married the party to the personality and presided over one of the greatest upsets in presidential election history.

Priebus had been embattled almost from the beginning. He was said to be at odds with senior adviser Steve Bannon and to be less than close to first daughter Ivanka Trump and her husband, Jared Kushner.

He was too old-school, too Midwestern, too conventional. When Anthony Scaramucci arrived as the new White House director of communications in mid-July, he was reporting directly to the president — not to Priebus. Bad sign.

So in Washington, among those who watch the White House, there could be little surprise. And yet the spectacle of the chief of staff sitting alone in a van in the rain at Joint Base Andrews on Friday evening — detailed in a pool report — was still, somehow, shocking.

But then it had been a week of whiplash in Washington.

Wherever you looked, something made you stare in disbelief — even when you sensed you should avert your eyes.

But then you couldn't. You might miss a major news development. They came tumbling one after another, more than one a day.

The biggest story for history was the Republican effort to repeal (and possibly replace) the Affordable Care Act, also known as Obamacare. It was a high-drama affair, with Sen. John McCain crossing the country to save his party on Tuesday and then crossing the aisle with the fatal vote that doomed its bill in the wee hours of Friday. Screenwriters would kill for that kind of material.

Yet even as the GOP's seven-year assault on Obamacare lurched and stumbled to a stop, the capital's attention was divided by other stories — some of lesser consequence but greater emotional impact.

On the basis of gaudy patter alone, who could ignore Scaramucci's antic rant on the phone to New Yorker reporter Ryan Lizza? It happened Wednesday night after Lizza reported on a White House dinner that Scaramucci thought was confidential.

Scaramucci, brash and still learning the ropes after less than a week on the job, demanded to know Lizza's source. Then he unleashed a scabrous and obscene defoliation of Priebus and senior adviser to the president Steve Bannon. ( Scaramucci later said it was meant to be off the record, a thought he apparently forgot to share with Lizza.)

That set off a round of furious speculation about the pecking order in Trump's inner circle. Would Priebus (whom Scaramucci called "a paranoid schizophrenic") be gone or would the new guy make an early exit?

We soon had the answer. Priebus had been with Trump far longer and his best connection to the party establishment. But Scaramucci seems to have succeeded where other surrogates have failed — channeling the world-class bravado of Donald Trump. Indeed, Scaramucci often appears to be imitating his boss in gesture and expression, reminding the world that he, too, is a bridge-and-tunnel kid who conquered Manhattan's business world on his own terms. Both are men of confidence that seems to know no bounds.

Even as the Priebus-Scaramucci drama erupted, much of the media world and official Washington were still agape over the president's treatment of a loyal campaign ally and Cabinet member. For the second consecutive week, Attorney General Jeff Sessions had to endure a barrage of brutal criticism from Trump, who called him "weak" and "beleaguered."

Clearly yearning to be rid of his own appointee, Trump nonetheless held off on firing him. That didn't stop the tsunami of pushback from Sessions' former colleagues in the Senate and elsewhere. Even the president's most ardent media backers, such as Breitbart News and Sean Hannity, rallied to Sessions' defense. The Alabamian had been, after all, a fixture of the conservative movement for decades when Trump was anything but. Moreover, Sessions was not only the first senator to endorse Trump but also the only one in the early going, when it really mattered.

Yet Trump rages on in protest of Sessions' recusing himself from the Justice Department's probe of Russian interference in the 2016 election. That recusal, which Trump says blindsided him, led to the naming of special counsel Robert Mueller, who has hired a crack team of investigators.

In the midst of the Sessions showdown, as if to change the subject, the president sent a series of tweets Wednesday morning announcing he had decided to ban transgender persons from the military. He said the services could not afford "the tremendous medical costs and disruption."

Far from offering evidence for either high costs or disruption, Trump gave no details, official orders or directives for the military to implement his new policy. The Pentagon, apparently caught unaware, had been awaiting the results of a study on impacts due in December. So the chain of command from the Joint Chiefs of Staff to the front-rank officers did not know what to do with the thousands of transgender personnel now on active duty or in the reserves. That was a specific concern for many of the objecting senators — in both parties.

Another hallmark of the Trump era has been the free-form oration before a throng of enthusiastic supporters. This past week gave us a variation on that theme, with an enormous crowd gathered in a field in West Virginia. But in this case, the crowd was composed of boys attending the Boy Scout Jamboree. It is a tradition for the president to serve as honorary head of the Boy Scouts of America and to address the Jamboree.

Trump was eager to oblige. He came to the Jamboree with Cabinet members who had been Scouts themselves (but not Sessions, who was an Eagle Scout). He had prepared remarks, but after saying, "Who the hell wants to talk about politics when they're with the Boy Scouts?" Trump proceeded to discuss the 2016 election, the current state of play in Washington ("We could use a little more loyalty") and other decidedly political topics. In addition, he hinted about the sexual escapades of a construction tycoon who had a large yacht and teased the Scouts about their familiarity with such things.

Three days later, after the video had been widely shared, the executive director of the Boy Scouts issued an apology for the "injection of politics" at the Jamboree.

As the week ended, North Korea was firing yet another intercontinental warning shot at the world in defiance of the United Nations and, of course, the United States. And Russia was announcing it would retaliate against U.S. sanctions by closing some U.S. facilities in Russia and paring the number of U.S. diplomats there.

On his desk next week, the president will find a bill awaiting his signature that would impose new sanctions on Russia and reinforce existing ones (including those imposed in response to the 2016 election interference). The bill also restrains Trump's power to lift the sanctions. There were just two no votes in the Senate, just three in the House. That is the definition of veto-proof, so on Friday, the White House announced the president would sign — even if Russian President Valdimir Putin condemns the bill as "a violation of international law."

Copyright 2017 NPR. To see more, visit http://www.npr.org/.