Leslie H. Gelb, an iconoclastic former American diplomat, journalist and prodigious commentator on world affairs, died on Saturday at NewYork-Presbyterian Hospital/Weill Cornell Medical Center in Manhattan. He was 82 .

The cause was renal failure brought on by diabetes, his wife, Judith Gelb, said.

Mr. Gelb was 30 years old when in 1967 he took day-to-day charge of the team that compiled the secret Pentagon Papers, which had been commissioned by Defense Secretary Robert S. McNamara.

He later worked as an editor, columnist and Pulitzer Prize-winning correspondent for The New York Times, the newspaper that had overcome a court challenge by the Nixon White House and in 1971 published the papers, which revealed a damning evolution of Washington’s intervention in Vietnam.

Mr. Gelb served as assistant secretary of state and director of the Bureau of Politico-Military Affairs during the Carter administration from 1977 to 1979. He was president of the Council on Foreign Relations, the prestigious New York-based think tank peppered with policy experts and former officials, from 1993 to 2003.