Imagine this scenario: A dangerously unhinged president, enraged that a prominent newspaper is about to reveal secrets he wants to keep, leverages the vast power of the White House to threaten the paper’s owner with utter financial ruin if the information is published. In-house lawyers strongly advise the owner to back down, warning that the newspaper’s survival is at stake. But it is clear that the public has the right to know what the president is trying to hide. What should the owner do? What would you do?

Again and again, Katharine Graham defied President Richard M. Nixon’s wrath and empowered The Post to publish journalism that changed the world. The courage and integrity of this remarkable woman, whom I was privileged to know, is at the heart of a new documentary — “Becoming Katharine Graham: The Only Woman in the Room” — that premiered Sunday night at the Kennedy Center.

I went to the screening and was flooded with memories of my first days as a young reporter in The Post’s newsroom. That was in 1980, and Mrs. Graham — I don’t think I ever addressed her without the “Mrs.” — was already a legend. The first time I actually met her, in an elevator at the paper’s old building on 15th Street NW, I could barely croak out a weak hello.

The documentary by Emmy-winning filmmakers Peter, Teddy and George Kunhardt covers the sweep of Graham’s long and eventful life: the support from her father, wealthy financier Eugene Meyer, who purchased The Post in 1933; the chilly emotional distance of her formidable mother, Agnes Ernst Meyer; the brilliance and charisma of her husband, Philip Graham, who suffered from bipolar disorder; her education in business management by investor Warren Buffett; and her constant struggle to overcome her own insecurity and self-doubt.

The Kunhardts give prominence to two pivotal episodes that established Graham’s place in history: the Pentagon Papers and Watergate.

An important piece of context is that Nixon seethed with contempt for the news media, which he believed had always belittled him and treated him unfairly. “Never forget: The press is the enemy,” he once told Henry Kissinger, his national security adviser. In that conversation, he repeated the phrase four times for good measure.

In 1971, a federal court ordered the New York Times to cease publishing articles based on a leaked, highly classified history of the Vietnam War that showed the government had lied to the American people for years about U.S. progress and prospects in the bloody conflict. The Times appealed the ruling but obeyed the court order.

Meanwhile, The Post obtained copies of some of the Pentagon documents. Graham’s privately owned company was in the process of going public; executives warned her that publishing revelations from the secret papers could tank the stock price — and also put the broadcasting licenses of The Post’s profitable television stations at risk. Ultimately, the decision was Graham’s alone.

She told her editors to publish. Less than two weeks later, in a landmark case, the Supreme Court vindicated her decision, ruling that lower courts should not have tried to restrain the Times and The Post from publishing. With her company on the line, Graham had done the right thing.

The following year, burglars were caught trying to plant listening devices at the offices of the Democratic National Committee in the Watergate office building. Post reporters Bob Woodward and Carl Bernstein doggedly traced the bugging attempt to the White House — and ultimately to Nixon’s desk in the Oval Office.

For months, other news organizations shied away from the story while Nixon and his thuggish attorney general, John N. Mitchell, pressured and threatened Graham to call off her bloodhounds. The television licenses, once again, were at risk. The Post’s stock price plummeted.

Once again, Graham did the right thing: She backed Ben Bradlee, her larger-than-life executive editor — and not only did she support Woodward and Bernstein, but she went so far as to take their notes home at night to her stately Georgetown residence, so that if Mitchell ever tried to subpoena and seize them, he would have to come through her. And once again, her bravery was vindicated: On Aug. 9, 1974, Nixon resigned.

As the documentary’s subtitle notes, Graham was indeed the only woman in the room. When she took over The Post after her husband’s suicide, the CEOs of the Fortune 500 companies included 499 men — and her. Few others on that list ended their careers having become an icon.

Donald E. Graham said on Sunday night that his mother never hosted a dinner party without inviting both Democrats and Republicans. She bowed to no president. I bow to her.

Eugene Robinson writes a column on politics and culture and hosts a weekly online chat with readers. Find him on X at: @Eugene_Robinson.