WASHINGTON — Let’s be clear: What happened Wednesday afternoon at the U.S. Capitol was an attempted coup d’état, egged on by a lawless president desperately trying to cling to power and encouraged by his cynical Republican enablers in Congress.

It was perhaps inevitable that President Donald Trump’s chaotic and incompetent tenure in office would end with riots and tear gas. Not since British Major Gen. Robert Ross set fire to the president’s residence and the Capitol building in 1814 have we seen such a scene at the hallowed citadel of our democracy, as an angry and disillusioned mob — whipped into a frenzy by Trump himself — forced its way into the Capitol to disrupt the official certification of Trump’s electoral defeat.

Images from this shameful day will endure forever: Crowds storming the security barricades, overwhelming outnumbered and seemingly unprepared Capitol police, and breaking windows to pour into the seat of American power. Police officers inside the House of Representatives chamber, guns drawn and aimed at the main doors, where protesters threatened to force their way inside. A scarf-draped rioter sitting smugly in the chair where, an hour earlier, Vice President Mike Pence had presided over the Senate.

The central act of our democracy — the peaceful and orderly transfer of power — was not allowed to take place. Blame the rioters themselves, who must take responsibility for their own actions. But blame Trump above all. And blame the Republican members of Congress who sought to boost their own political fortunes by validating Trump’s self-serving paranoid fantasies.

I mean you, Sen. Josh Hawley of Missouri. And you, Sen. Ted Cruz of Texas. And you, Rep. Steve Scalise of Louisiana. And all the rest who thought that the way to succeed in GOP politics was to pretend to believe Trump’s lies rather than tell the nation the truth.

Trump told his MAGA legions that he didn’t really lose the election, that in fact he could not possibly have lost, and that somehow he would manage to remain their president for a second term. First, various recounts would save him — until they all confirmed Joe Biden’s victory. Then it was going to be the certifications of the vote totals — but all the states certified their results. Then it was going to be the courts that rode to the rescue — but courts at every level, including the U.S. Supreme Court, tossed out his frivolous lawsuits like so much scrap paper.

Finally, on Jan. 6, Congress — or perhaps Pence, acting alone — would surely throw out the electoral votes from states Trump falsely claimed to have “won,” thus giving him the glorious victory he deserved. He urged his followers to come to Washington to “Stop the Steal” — to keep Congress from doing its constitutional duty in counting the electoral votes. And Hawley, Cruz, Scalise and scores of other congressional Republicans went along with this ridiculous fairy tale so as not to anger the president or his supporters.

But then Jan. 6 arrived. Pence issued a statement early in the day making clear that he would obey the Constitution, not Trump’s autocratic wishes. And the many thousands of Trump supporters who had gathered on the Ellipse to hear Trump give a long and angry rant, and who obeyed his order to march on the Capitol, became a guided missile aimed at the heart of U.S. democracy.

They were like a doomsday cult when the appointed day arrives and the foretold asteroid does not strike. Trump had convinced them he could not possibly lose, yet inside the Capitol he was losing.

They decided to prevent the transfer of power by force. Shots were fired, and one person was struck and killed. Tear gas was deployed. The scenes were like those I saw in places like Paraguay and Peru as a foreign correspondent — and nothing like we’ve ever seen in the United States.

Biden gave a televised address calling for an end to the “insurrection” and the restoration of “decency, honor, respect, the rule of law.” Trump posted a desultory video statement on social media urging rioters to “go home” but repeating his claims that the election was “stolen.”

It is possible to see better days ahead. Biden is a good man and a lifelong public servant. Georgia voters have given the Republican Party the punishment it deserves by putting Democrats in control of the White House and both houses of Congress. Inauguration Day is just two weeks away.

But somehow our damaged nation has to make it through those next two weeks. Police and the National Guard are more than capable of re-establishing order in the streets. The wounds Trump has inflicted upon the nation, however, are ragged and deep. We will be paying for the mistake of electing this bitter, twisted man as president for a long, long time.

Eugene Robinson is on Twitter:

@Eugene_Robinson