WASHINGTON - Robert 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 Tuesday 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 Dr. Warner 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 sprang the Archives free. President Ronald Reagan signed legislation making the agency the National Archives and Records Administration as it celebrated its 50th anniversary in 1984.

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," said Allen Weinstein, the current national archivist.

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 Wick. His careful response to congressional requests for President Richard 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."

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.