Robert M. Warner, 79, who led the National Archives to independence even while dealing with Reagan-era budget cuts and the political equivalent of live fire over the release of Oval Office recordings, died of a heart attack April 24 at Arbor Hospice and Home Care in Ann Arbor, Mich.

As the sixth archivist of the United States, Dr. Warner oversaw the cloistered stacks where Alex Haley and countless amateur genealogists discovered their roots and the high-profile cathedral for the nation's most valued documents, the Constitution and Declaration of Independence.

When he was appointed archivist by President Jimmy Carter in 1980, the agency labored under the oversight of the General Services Administration, which regarded it primarily as a warehouse and records repository. Through a persistent behind-the-scenes campaign waged through historical and genealogical associations, Dr. Warner sprung the Archives free. President Ronald Reagan signed legislation making the agency the National Archives and Records Administration just as it celebrated its 50th anniversary.

In appreciation, the research center at the renovated Archives building was named for Warner in 2005. "We owe Bob the achievements of the last 22 years," Allen Weinstein, the current national archivist, said.

It was a seminal moment, because the Reagan administration was reducing the federal government, not expanding it. Archivists hail it as the moment when they knew their work was taken seriously.

Dr. Warner's work was not met with celebration on all fronts. His efforts did not make the GSA happy. He wrangled with the U.S. Information Agency in 1984 when its lawyers refused to allow archivists to review transcripts of telephone conversations recorded secretly by then-director Charles Z. Wick. His careful response to congressional requests for President Nixon's Oval Office tapes and transcripts infuriated some politicians.

"The three-decade war over the Nixon papers and tapes began that year," Weinstein said. "It's taken 30 years, but we're finally near the end. Bob basically prepared us for the long haul."

When Dr. Warner arrived in Washington, the agency was running out of space and stored some of its priceless documents in an old downtown department store that was a firetrap. Plans to distribute original records from Washington to regional centers caused professional researchers to howl in frustration. Government documents, printed on cheap, lowest-bidder paper, were disintegrating, and the agency was starved of funds.

"But where [GSA Administrator Rowland Freeman] liked to administer straight vinegar ('I'm used to giving orders,' he told the advisory council last year), Warner is trying a little honey ('My arrival here does mean change,' he told the staff at his introduction, but added 'My work will be built on your work')," an article in The Washington Post said.

Robert Johnson, the National Park Service archivist and president of the Society for History in the Federal Government, recalled as a graduate student coming across Dr. Warner in the stacks.

"There was the national archivist sitting at a worktable going through boxes," Johnson said, still sounding astonished more than 20 years later. It apparently wasn't his only foray into the files.

"Some of the most interesting things are the files on ordinary people," he told a reporter in 1984. "Those early pension files -- they're like oral history. You also find a lot in the presidential papers, where they write about their problems."

Dr. Warner was born in Montrose, Colo., graduated from Muskingum College in Ohio and received a doctorate in American history from the University of Michigan in 1958. He worked at the Michigan Historical Collection and became its third director in 1966. He became friendly with a local Republican congressman, Gerald R. Ford, who sent his papers to the collection. When Nixon resigned and Ford was unexpectedly elevated to president, Dr. Warner, director of the university's Bentley Historical Library, figured out how to establish Ford's presidential library and museum with little of the expected controversy.

After leaving Washington, Dr. Warner returned to the university, where he was dean of the School of Information from 1985 to 1992, and helped lead the profession in developing ways to handle electronic documents and archives.

His wife of 52 years, Jane Bullock Warner, died in August 2006.

Survivors include two children, Mark Warner of Moscow, Idaho, and Jennifer Cuddeback, an archivist at the Lyndon B. Johnson Library in Austin; and two grandchildren.

His son noted that his father left Washington soon after the Archives became independent.

"He got out on top," his son said. "People very rarely leave that town happy. In retrospect, it's pretty extraordinary. The archives became independent on April 1 and he retired when, April 15? It was his crowning achievement."