From the viewpoint of disgraced Democratic ex-congressman Anthony Weiner, it probably seemed like a good idea. After a spectacular fall from grace, when he accidentally tweeted a photo of his erect penis to his thousands of twitter followers, the supposedly chastened Weiner decided to run for mayor of New York City in 2013.

Convinced of a political comeback, the charismatic Weiner gave full documentary access to his former chief of staff, Josh Kriegman and co-director Elyse Klingman. Weiner had yet another ace up his sleeve. Goading him on was the loyal wife and mother of his child, power broker Huma Abedin, Hillary Clinton’s closest adviser in her current presidential campaign.

The first thirty minutes of Weiner finds the scrappy underdog gaining traction with wary New York voters who want to believe the candidate has given up sexting his female admirers. But then it all comes crashing down. New phone sex allegations arise well after Weiner’s original mea culpa. Any chance of redemption becomes a chaotic, gleeful media takedown of Weiner who quixotically decides to continue the race despite the toll on his marriage and the sheer impossibility of winning.

It’s depressing but the timely Weiner will probably become a documentary cornerstone about the intimate workings of the American electoral process alongside Robert Drew’s seminal Primary (1960) and Chris Hegedus and D.A. Pennebaker’s Clinton victory chronicle The War Room (1993). The difference is that Weiner is not about triumph but instead captures the nominee’s fiery, self-destructive crash to earth from directly inside the cockpit. Klingman and Kriegman’s nuanced document is compellingly cringeworthy and thoroughly entertaining, often in the same scene.

Once the new sexting scandal breaks, Weiner and Abedin try to quickly figure out a statement while the press jockeys for standing room outside their office. Weiner asks his assistant to leave but allows the camera to remain. As the couple scrambles to contain the damage, the television begins to show Anthony Weiner’s latest penis photos; pictures not yet seen by Abedin. The painful silence that ensues is an astonishing kidney punch of grief and collapse, the end of his election chances and their marriage (Weiner and Abedin separated this August).

Despite this, Weiner stubbornly decides to soldier on with the election run. The last hour of the doc is a dizzying series of combative skirmishes, highlighted by surreal press conferences and theatrical television appearances.

weiner_still5_anthony_weiner_crseanmcging_sundance_selects-1-3a208991In one extraordinary sequence, Weiner makes a scheduled appearance at New York’s City Island, a constituency particularly sickened by his misdeeds. The tense meeting opens with hisses and boos but somehow, through the haze of hostile abuse, the brash politician turns the mood of the room around even managing to get a round of applause. Like many of the contradictory emotions running throughout the film, it’s in these moments we find ourselves oddly rooting for the plucky yet recklessly doomed Weiner.

Anthony Weiner has claimed that neither he nor Huma Abedin have watched the film that went on to win the Grand Jury Doc Prize at this year’s Sundance. Despite this, Weiner has expressed annoyance with the filmmakers who, he claims, are overstating the appearance of Abedin to sell the film.

Yet, even standing silently in the background, she remains perhaps Weiner’s most fascinating figure. Amid the chaos of her husband’s meltdown, Abedin, thoroughly aware of the camera and the impact the exposure may have on Hilary’s campaign, never loses her composure. Many will recall a host of revealing episodes. But is there anything more indelible in Weiner than the image of Huma Abedin responding to the cameraman’s inquiry of how she’s holding up with the forlorn: ‘‘It’s like living a nightmare.’’?

The Election Day finale unfolds with the kind of dramatic fireworks that seem to come from the pen of a fiction film screenwriter. One of Weiner’s phone sex contacts, a Las Vegas blackjack dealer turned porn actress, Sydney Leathers, decides to camp out in front of the campaign office, the media in tow.

Klingman and Kriegman deftly lay out the details of a pathetic plan in which the defeated Weiner avoids Leathers by ducking into a nearby McDonalds. Weiner’s sole moment of awareness seems when he advises the humiliated Abedin to head home first. Ironically, the only thing that saves Weiner from a direct confrontation is Leathers inability to squeeze past the melee of cameras chasing him up the back stairs.

Perhaps the bitterest pill to swallow about Weiner is its pitch perfect portrayal of both the failed American political system along with the pitiable reality show state of journalism in the age of Trump. In the final minutes, cameraman Kriegman asks the broken Weiner, ‘‘Why have you let me film all this?’’. Word has it that an A-list documentary filmmaker is currently following Hillary Clinton on her presidential run, a doc in which Huma Abedin may figure prominently. Is it any wonder?