Charles Hill, a Cold War diplomat who advised two secretaries of state and the head of the United Nations before reinventing himself as a university professor, founding Yale’s influential Grand Strategy program to connect history and literature to the study of statecraft, died March 27 at a hospital in New Haven, Conn. He was 84.

The cause was complications from an infection, said his friend Justin Zaremby.

Laconic and soft-spoken, Mr. Hill spent nearly his entire government career working behind the scenes, avoiding photo ops while serving as a speechwriter and aide to secretaries of state Henry Kissinger and George P. Shultz. He was later a policy consultant to Boutros Boutros-Ghali, the secretary general of the United Nations, during a tumultuous period in the 1990s that included the breakup of Yugoslavia, genocide in Rwanda and civil war in Somalia.

“Attention isn’t something that’s very interesting to me. It seems to use a lot of time that could be spent on something else,” he told the Hartford Courant in 2006. “Ronald Reagan had a plaque on his desk which read, ‘There’s no limit to what you accomplish, as long as you don’t care who gets the credit.’ ”

A self-described “Edmund Burke conservative,” Mr. Hill championed what he described as the liberal world order, arguing in recent years that Islamism posed a global threat and that the United States “has to stand for democracy.” In 2008, he served as the chief foreign policy adviser for former New York mayor Rudolph W. Giuliani’s presidential campaign.

Mr. Hill started out in the Foreign Service, with postings in Europe, East Asia and South Vietnam, where he was a speechwriter for Ambassador Ellsworth Bunker. He later advised Bunker on the Panama Canal treaty negotiations and, in 1974, began working for Kissinger as a speechwriter.

“He reviewed almost everything I wrote,” the former secretary of state said in a phone interview. “What made him effective was his thoughtfulness, his unselfishness, his dedication to ideas, his understanding of human beings.” Mr. Hill, he added, possessed an “acute judgment” on issues ranging from the evolution of China to the Arab-Israeli conflict, which he increasingly focused on during the Carter administration.

Mr. Hill served as political counselor for the U.S. Embassy in Tel Aviv, director of Arab-Israeli affairs and deputy assistant secretary of state for the Middle East. In 1985, he was named executive aide to Shultz, a post that made him chief of staff to Reagan’s top diplomat during a period that included nuclear-weapons negotiations with the Soviet Union and efforts to start a dialogue with Palestinian leader Yasser Arafat.

In part, “his influence lay in his quite extraordinary, relentless note-taking,” said his former student Molly Worthen, author of “The Man on Whom Nothing Was Lost,” a 2006 biography of Mr. Hill. He produced about 20,000 pages of notes — chronicling everything from a religious ceremony in Fiji to comments that Soviet leader Mikhail Gorbachev’s wife, Raisa, made at dinner — resulting in documents that shaped policy discussions.

“I don’t think there was anyone that Shultz trusted more,” Worthen said.

Mr. Hill’s note-taking drew national attention in the wake of a scandal known as Iran-contra, in which the Reagan administration secretly sold weapons to Iran in an effort to win the release of American hostages in Lebanon. Profits were diverted to fund right-wing Nicaraguan rebels known as the contras, in violation of congressional restrictions on such aid. Shultz, who died in February, was one of the few senior members of the administration to emerge unscathed.

Mr. Hill’s notes helped guide the Iran-contra special prosecutor, Lawrence E. Walsh, leading to the discovery of additional notes from Defense Secretary Caspar W. Weinberger, who was indicted and was later pardoned by President George H.W. Bush. Together, the two officials’ notes constituted “an extraordinary record of administration plotting, agonizing and infighting,” according to a 1993 Washington Post report.

After Bush took office, Mr. Hill resigned from the Foreign Service and helped Shultz write his 1993 memoir, “Turmoil and Triumph.” Three years later he began teaching full time at Yale, ranging across traditional disciplinary boundaries while leading seminars on Aristotelian statecraft, political oratory and Tibetan civilization, among other subjects.

He was best known for his year-long course Studies in Grand Strategy, which he created in 2000 with historians John Lewis Gaddis and Paul Kennedy. Loosely modeled after a class at the Naval War College in Rhode Island, the course examined large-scale issues of statecraft and social change while drawing on classic works of history and literature.

“The international world of states and their modern system is a literary realm; it is where the greatest issues of the human condition are played out,” he wrote in a 2010 book, “Grand Strategies,” which examined the development of the modern state with help from works by Homer, Thucydides, Franz Kafka and Salman Rushdie.

Mr. Hill came to embody the Grand Strategy course, which was credited with inspiring similar classes at schools including Duke and the University of Texas. Addressing students by their last name, holding open-door office hours each week, he developed a devoted following among undergraduates, even as liberals on campus joked that his class should be called “Grand Fascism.”

“Charlie’s criticism of the Clinton administration was always that it was a bunch of very, very smart wonks who can’t see the forest for the trees,” Worthen said. Mr. Hill and his colleagues “were reasserting the need to talk about giant ideas and not simply make foreign affairs a matter for the technocrats,” she added. “And then 9/11 happened. I was an undergraduate then, and we were so hungry for someone to explain it to us.”

Morton Charles Hill was born in Bridgeton, N.J., on April 28, 1936. His father was a dentist, his mother a homemaker.

He received a bachelor’s degree from Brown University in 1957 and studied at the University of Pennsylvania, where he graduated from law school in 1960 and earned a master’s degree in American studies in 1961, shortly before joining the Foreign Service.

Mr. Hill was later a research fellow at the Hoover Institution, a conservative public policy think tank at Stanford University.

His marriage to Martha Mitchell (unrelated to the Watergate-era political figure) ended in divorce, and in 1992 he married Norma Thompson and joined her part time at Yale, where she was a political science professor.

In addition to his wife, of New Haven, survivors include a daughter from his first marriage, Catharine L. Smith of Washington; and two grandchildren. Another daughter from his first marriage, Emily C. Hill Van Lieu, died in 2013.

In an interview, his colleague Gaddis said that Mr. Hill focused on literature even more than his Grand Strategy partners, believing that great books offered “a kind of inner vision of how people’s emotions or minds are working.”

“Yale administrators didn’t know what to do with him, where to put him,” he added. “He existed outside of departmental structures. More significantly, he existed outside of specialties. I would say his specialty was finding linkages between specialties. It’s the opposite of siloing, looking for connections across disciplinary boundaries. And of course, there is almost nobody else around at Yale who does that now.”