Daniel Ellsberg went to Vietnam for the first time in September 1961 as part of a Pentagon fact-finding task force. He hoped to learn that the South Vietnamese government of Ngo Dinh Diem, with U.S. backing, was defeating the Communist-led insurgency of the Viet Cong. After all, Ellsberg was a dedicated cold warrior, a foreign policy hawk. He discovered, instead, that Saigon was losing the war; a Communist victory seemed virtually inevitable. Returning to his job at the RAND corporation think tank in Santa Monica, California, he advised colleagues to avoid studying Vietnam–it might taint their careers. Ellsberg himself went back to his work on nuclear war plans.

Three years later, a call came from Robert McNamara’s Pentagon. They wanted Ellsberg to come to Washington and work entirely on Vietnam policy. Despite his pessimism about the war, he believed in the cause. More than that, advising the nation’s highest officials was Ellsberg’s greatest ambition. If he put his probing, analytical mind to the problem, maybe he could help identify a solution.

His first full day on the job was August 4, 1964–the very day President Lyndon Johnson ordered American warplanes to attack North Vietnam in “retaliation” for what he described as an “unprovoked” and “unequivocal” attack on two U.S. destroyers in the Gulf of Tonkin. Ellsberg knew both claims were untrue. The U.S. had been waging a small covert war against North Vietnam for several years. He also read flash cables from the Pacific warning that the alleged North Vietnamese attack may never have happened.

Yet Ellsberg remained a loyal official. He helped plan military escalations in Vietnam even as President Johnson promised voters that he would avoid a “wider war.” In early 1965, Ellsberg dug up dirt on the southern Viet Cong to help the White House justify a bombing campaign against North Vietnam. Years later he considered it “the worst thing I’ve ever done.” He also defended the war at college “teach-ins” where a peace movement was rising. And he defended it to his new girlfriend and future wife, Patricia Marx, who opposed the war and persuaded Ellsberg to attend an antiwar demonstration on their first date.

Convinced his relationship with Marx was doomed, Ellsberg decided to go to Vietnam for the State Department to join a small team seeking a more effective way to wage counter-insurgency warfare. At first, he was thrilled by the challenge. He loved driving the dangerous backroads and visited nearly every province in South Vietnam, determined to find answers. He embraced the ambition of boosting South Vietnamese popular support for their undemocratic and repressive government by holding honest and open elections. He also wanted to persuade the U.S. military command to eliminate indiscriminate bombing and shelling, a practice that not only killed and maimed civilians, but led many to join the Viet Cong. These recommendations fell on deaf ears. None of the proposed reforms gained traction.

Equally disturbing, out in the field, accompanying U.S. and South Vietnamese military units, Ellsberg saw first-hand the skill and fervor of the guerrilla forces. Despite the vast U.S. advantage in firepower, there seemed no way to break the will of the adversary. And the South Vietnamese military was riddled with corruption, incompetence, and war-weariness. Ellsberg increasingly felt like a foreign invader fighting in the enemy’s backyard. Once, in the Mekong Delta, he was with a unit that was repeatedly ambushed by the Viet Cong. At the end of the day, Ellsberg turned to an American sergeant and asked, “Do you ever feel like the Redcoats?”

“I’ve been thinking that all day,” replied the sergeant.

By the time Ellsberg left Vietnam in 1967, recovering from hepatitis, he had concluded that the war was an unwinnable stalemate from which the United States should try to find a face-saving exit. Over the course of the next two years, his view would grow far more radical. He would come to see the war not only as a mistaken intervention, but as an American war of aggression—unjust, immoral, and criminal, a war that must be ended immediately. What, he began asking, might he do to end the war if he were willing to risk everything—his career and even his freedom?