President Reagan and Nancy Reagan sitting with Peter Hannaford (right) in the Diplomatic Reception Room of the White House in 1981. (Courtesy of Ronald Reagan Library)

Peter D. Hannaford, a speechwriter, author and public-relations specialist who was a key aide to Ronald Reagan from his years as California governor to his 1980 presidential campaign, died Sept. 5 at his home in Eureka, Calif. He was 82.

Mr. Hannaford had recently finished editing for publication the 1960s diaries of newspaper columnist Drew Pearson and had signed copies of the volume Saturday night at a bookstore in Eureka. He went home in good spirits and did not wake up the next morning, said his wife, Irene Hannaford. She said she did not know the immediate cause of death.

An advertising and public-relations executive in California, Mr. Hannaford joined then-Gov. Reagan in 1974 as his administration’spublic-affairs director. When Reagan left office the next year after two terms, Mr. Hannaford teamed with ex-Reagan aide Michael K. Deaver to handle radio broadcasts, newspaper columns and appearances that kept the presidential aspirant in the public eye.

Mr. Hannaford came to be recognized as a member of Reagan’s inner circle in those years. He was credited with a role in the preparation of speeches during Reagan’s unsuccessful bid for the Republican nomination in 1976 and his election in 1980.

“Oh, he was a breeze to work with, just a dream to work with,” he said of Reagan in a 2003 oral history interview with the Miller Center of Public Affairs at the University of Virginia. “As we got to know one another well and he knew I would write in his voice, he would just say, ‘Pete, take a crack at this.’ ”

After receiving drafts, Reagan would scratch out phrases and replace them with new ones, but he tried not to bruise feelings.

“He was always so apologetic when he changed things.” Mr. Hannaford said. Returned drafts included such annotations as, “You know, that’s good,” followed by, “but let’s try this.”

During the 1980 Republican National Convention in Detroit, Mr. Hannaford was on hand for the behind-the-scenes maneuvering, in which it appeared for a time that former president Gerald R. Ford would be chosen as Reagan’s vice presidential running mate.

After a period of uncertainty, it was determined that Ford would not accept.

In the Miller Center interview, Mr. Hannaford recounted what happened next in Reagan’s convention hotel room.

“One of us — I think it was me, but I may not have been the only one — said to him a few minutes later when he was sitting on the sofa, ‘Isn’t it time to call George [H.W.] Bush?’ ”

Bush, a former congressman and CIA director, had been a contender for the GOP nomination and was at the convention.

“Bush had been having a beer in the lounge in his hotel, figuring that it was all over, and had retired to his room,” Mr. Hannaford said, adding that Bush was “astonished” by the call to be Reagan’s running mate.

Peter Dor Hannaford was born in Glendale, Calif., on Sept. 21, 1932, and grew up in Piedmont, Calif. He graduated in 1954 from the University of California at Berkeley, then spent two years in the Army Signal Corps.

Mr. Hannaford, a Republican, ran for public office in 1972, seeking the congressional seat for the district that included Berkeley. He was defeated by incumbent Ron Dellums, a Democrat.

In the 1980s, Mr. Hannaford was part of the White House Preservation Fund staff. In the latter part of his career, he wrote or edited books, many of them focused on Reagan. He also wrote political commentary and book reviews for conservative publications.

In 1954, he married Irene Harville. Besides his wife, of Eureka, survivors include two children, Richard Hannaford of Sacramento and Donald Hannaford of Rumson, N.J.; and two grandchildren.

Even after his formal ties with Reagan ended, Mr. Hannaford would from time to time send a few words or thoughts to the president. The last time he did so, he recalled, was in 1988 near the end of Reagan’s term.

He had come across a saying attributed to a Chinese philosopher: “Govern a great country as you would cook a small fish.” Mr. Hannaford said he knew it would appeal to Reagan’s belief in applying only a light touch to free-market enterprise.

“I knew he would like it,” Mr. Hannaford said. “And sure enough, it was in the State of the Union speech.”