The Pentagon Papers is the colloquial term for United States-Vietnam Relations, 1945-1967: A Study Prepared by the Department of Defense, a 47 volume, 7,000-page, top-secret United States Department of Defense history of the United States' political and military involvement in the Vietnam War from 1945 to 1971, with a focus on the internal planning and policy decisions within the U.S. Government. The study was commissioned in 1967 by Robert McNamara, then Secretary of Defense. McNamara appointed Leslie H. Gelb, who was also director of policy planning at the Pentagon, as director of the project. Gelb hired 36 military officers, civilian policy experts, and historians to write the monographs that constituted the content of the project. The Papers included 4,000 pages of actual documents from the 1945-1967 period, and 3,000 pages of analysis.
Most, but not all of the Pentagon Papers were given ("leaked") to Neil Sheehan of The New York Times in early 1971 by a former State Department official Daniel Ellsberg, with his friend Anthony Russo assisting in copying them. The Times began publishing excerpts as a series of articles on June 13.  Controversy and lawsuits followed. On June 29, U.S. Senator Mike Gravel of Alaska entered 4,100 pages of the Papers into the record of his subcommittee on Buildings and Grounds. These portions of the Papers were subsequently published by Beacon Press.  The full papers have never been published; they are locked in the classified vault of the LBJ Presidential Library.
The Papers revealed, among other things, that the government had deliberately expanded its role in the war by conducting air strikes over Laos, raids along the coast of North Vietnam, and offensive actions taken by U.S. Marines well before the American public was told about the actions, and while President Lyndon Johnson had been promising not to expand the war. The document increased the credibility gap for the U.S. government, and was seen as hurting the efforts by the Nixon administration to fight the war.
According to Anthony Lewis's contribution in the coursepack from James Goodale's (former inhouse counsel to the Times) law school course on Old Media, New Media the Times received advice from inhouse counsel not to publish. Goodale counseled otherwise, reasoning that the press had a First Amendment right to print material of such significance to the people's understanding of government policy. The Nixon adminstration, however, argued that Ellsberg and Russo had no legal authority to release classified documents and were therefore guilty of a felony in providing them to the "Times".
One of the "credibility gaps" that the Times wrote of was that a consensus to bomb North Vietnam had developed in the Johnson administration on September 7, 1964, before the U.S. presidential elections.  However, according to the same Papers, none of the actions recommended by the consensus on September 7 involved bombing North Vietnam.  On June 14, 1971 the Times declared that the Johnson administration began the last rounds of planning for a bombing campaign in November.
Another controversial issue was the implication by the Times that Johnson had made up his mind to send U.S. combat troops to Vietnam by July 17, and this became the basis for an allegation that he only pretended to consult his advisors from July 21-July 27. This was due to the presence of a cable which stated that "Vance informs McNamara that President has approved 34 Battalion Plan and will try to push through reserve call-up."  When the cable was declassified in 1988, it was revealed that it read "there was a continuing uncertainty as to his [Johnson's] final decision, which would have to await Secretary McNamara's recommendation and the views of Congressional leaders particularly the views of Senator Russel." 
When the Times began publishing its series, President Nixon became incensed. His words to National Security Advisor Henry Kissinger that day included "people have gotta be put to the torch for this sort of thing..." and "let's get the son-of-a-bitch in jail."  After failing to get the Times to voluntarily stop publishing, Attorney General John Mitchell and President Nixon requested and obtained a federal court injunction that the Times cease the publication of excerpts. The Times appealed the injunction that was issued, and the case began (quickly) working its way through the court system.
On June 18, the Washington Post began publishing its own series of articles. Ben Bagdikian, a Post editor, had obtained portions of the Papers from Ellsberg. That day the Post received a call from the Assistant Attorney General, William Rehnquist, asking them to stop publishing the documents. When the Post refused, the Justice Department sought another injunction. The U.S. District court judge refused, and the government appealed.
On June 26 the Supreme Court of the United States agreed to take both cases, merging them into the case New York Times Co. v. U.S. ( 403 US 713). On June 30, the Supreme Court held in a 6-3 decision that the injunctions were unconstitutional prior restraints and that the government had not met the heavy burden of proof required for prior restraint. The justices wrote nine separate opinions, disagreeing on significant substantive issues. While it was generally seen as a victory for those who claim the First Amendment enshrines an absolute right to free speech, many felt it was a lukewarm victory at best, offering little protection for future publishers when claims of national security are at stake.
Thomas Tedford and Dale Herbeck summed up the reaction of editors and publishers at the time:
"As the press rooms of the Times and the Post began to hum to the lifting of the censorship order, the journalists of America pondered with grave concern the fact that for fifteen days the 'free press' of the nation had been prevented from publishing an important document and for their troubles had been given an inconclusive and uninspiring 'burden-of-proof' decision by a sharply divided Supreme Court. There was relief, but no great rejoicing, in the editorial offices of America's publishers and broadcasters." (Tedford and Herbeck, pp. 225–6 )