James O'Keefe's anti-media organization Project Veritas schemed to hurt The Washington Post and help Roy Moore.

But the Post turned the tables and exposed the plot. Now O'Keefe is the one on the defensive.

It's an extraordinary and sordid story that begins with a fake sexual assault allegation. The apparent goal was to discredit the real women who previously spoke with the Post about alleged sexual misconduct by Moore, the Republican nominee for Senate in Alabama.

O'Keefe, a highly controversial activist, had one of his colleagues reach out to the Post with a new, made-up account of Moore's behavior. The woman claimed that Moore had slept with her and even urged her to get an abortion.

The hope within Project Veritas appears to have been that the Post would reveal anti-Moore bias in the initial conversations and perhaps eventually publish the lie.

But the paper didn't bite. Instead, as it would with anyone who came forward with an explosive allegation, it looked into the new accuser's credibility and background -- and found a trail of breadcrumbs that led back to Project Veritas.

The Post described what happened, in exquisite detail, on Monday night. The account has been the most-read story on WashingtonPost.com for the past eighteen hours.

Related: What James O'Keefe doesn't get about the media

O'Keefe essentially copped to it in an email to his supporters.

"Following months of undercover work within The Washington Post, our investigative journalist embedded within the publication had their cover blown," O'Keefe wrote. "This is how undercover work goes. This isn't the first time that has happened, and it won't be the last time."

On Twitter, O'Keefe is now spinning, saying he has other Post-related videos in the works.

But the videos he shared on Monday night were underwhelming. A reporter for the newspaper was shown on a hidden camera saying that the paper's editorial board has an anti-Trump bent -- a fact that every reader already knows.

Armed with donations, hidden cameras and his YouTube account, O'Keefe has targeted CNN and several other major news organizations. He says he is exposing bias and "corruption" in the media. He uses the "investigations" to raise more money for Project Veritas.

One of O'Keefe's supporters, back in 2015, was Donald Trump's charity, the Trump Foundation. According to Post reporter David Fahrenthold, Project Veritas received a $10,000 donation "after pitching Trump on their work."

Trump also promoted some of O'Keefe's past projects on Twitter before he was elected president.

O'Keefe has many detractors, some of whom say his salesman techniques are an attempt to mask unethical practices.

He has a tendency to exaggerate his findings. Some of his so-called exposés have relied on misleading editing techniques. And an incident in 2010 landed him in legal trouble. After he was arrested at Senator Mary Landrieu's office, O'Keefe pleaded guilty to a misdemeanor for entering federal property under false pretenses. He was sentenced to three years of probation, plus community service and a fine.

Some of O'Keefe's longtime critics reacted gleefully. "Conservative tries to prove the Washington Post is fake news, proves the opposite by mistake," Jonathan Chait of New York magazine wrote.

A number of conservative writers and observers also sided with the Post. National Review's headline was "James O'Keefe Shoots at The Washington Post and Misses."

Byron York of the Washington Examiner tweeted that what he called O'Keefe's "idiocy" was "beyond boneheaded." He said "O'Keefe really ought to hang it up."

And Ben Shapiro, editor in chief of the Daily Wire, said the botched sting was "horrible."

"O'Keefe did great work on ACORN. This WaPo attempt is horrible, both morally and effectively," Shapiro tweeted.