Like many movies that turn the past into entertainment, “The Post” gently traces the arc of history, while also bending it for dramatic punch and narrative expediency. The filmmakers fold in atmospheric true-to-life details, like the poster for the western film “Butch Cassidy and the Sundance Kid” (a favorite of the real Mr. Ellsberg) that Daniel and some longhair pals sweep past on their way to illegally copying the Pentagon Papers. And while it’s no surprise that the movie omits and elides important players and crucial episodes, its honed focus jibes with the view of the former New York Times columnist Anthony Lewis, who wrote that the “public disclosure of the Pentagon Papers challenged the core of a president’s power: his role in foreign and national security affairs.”

That challenge becomes the movie’s cri de coeur, its reason for being. And, as that challenge becomes a crusade, it leads to some lump-in-the-throat grandstanding about the press and its relationship to power. Ben and Katharine each have friends in high government places. These allegiances — to friends, to state authority — are tested by the Pentagon Papers, if rather more tested, perhaps, for the purposes of this fiction. Graham’s husband, Phil, and Bradlee were both close with John F. Kennedy. In her memoirs, Graham writes that her friend McNamara helpfully advised The Times on a legally sensitive letter about the Pentagon Papers, a detail that underscores the depth of these powerful allegiances.

The Pentagon Papers — officially titled “Report of the Office of the Secretary of Defense Vietnam Task Force” — is an encyclopedia of outrageous decisions and acts, what Mr. Ellsberg once described as “evidence of lying, by four presidents and their administrations over twenty-three years, to conceal plans and actions of mass murder.” Mr. Ellsberg didn’t stop the war, but he did assert our right, and obligation, to challenge absolute power. That may be why the filmmakers — the script is by Liz Hannah and Josh Singer — slip in a bit from a speech that Mario Savio delivered two years before “The Post” opens and which memorably asserts: “There’s a time when the operation of the machine becomes so odious, makes you so sick at heart, that you can’t take part!”

There’s more than a little corn and wishful thinking in the high-minded moments in “The Post”; movies like either to glorify or demonize journalists, relying on heroes and villains. Yet given the recent assaults on journalism and the truth, this heroizing is also irresistible. And Mr. Spielberg, a shrewd entertainer who can be waylaid by moralism, rarely lets virtue drag this movie down. He lightens the heaviness with humor, physical comedy (fumbling, stumbling) and a perfectly synced cast that includes the funnymen David Cross, Zach Woods and a terrific Bob Odenkirk. As a filmmaker, Mr. Spielberg invariably comes down on the side of optimism; here, that hopefulness feels right. It also feels like a rallying cry.