Dr. Pastor, shown here at right with President Jimmy Carter, died Jan. 8. He was 66. (Family photo)

Robert A. Pastor, a Latin America specialist who was a top U.S. negotiator of the 1977 Panama Canal treaties, and who through scholarship and diplomacy sought to strengthen U.S. relations with countries to the south, died Jan. 8 at his home in Washington. He was 66.

The cause was colon cancer, said his son, Kip Pastor.

In a varied career lasting nearly four decades, Dr. Pastor became a trusted adviser to presidents, a respected figure in foreign affairs and a prolific academic.

He rose to perhaps his most influential role right out of graduate school at Harvard in 1977, when Zbigniew Brzezinski, President Jimmy Carter’s newly named national security adviser, hired Dr. Pastor as the National Security Council’s director of Latin American and Caribbean affairs.

“I picked him out just on the basis of my instinct and knowledge of him,” Brzezinski said in an interview on Thursday, noting that Dr. Pastor’s age at the time — 29 — made the decision “quite a precedent-breaking thing.”

Dr. Pastor worked on matters ranging from democracy promotion and human rights to arms control. His most important task, Brzezinski said, was the matter of the Panama Canal Zone.

Since 1903, the United States had controlled the waterway and surrounding area. Some foreign policymakers, including many in the Carter administration, had come to regard the arrangement as imperialistic and unsustainable.

But the proposed solution — transferring control of the canal to the Panamanians — provoked bitter controversy in Congress. Critics decried the proposition as a “giveaway.”

Dr. Pastor played a critical role working out a compromise, Brzezinski said.

“The night before the first vote, it was too close,” Dr. Pastor told the Chicago Tribune years later. “The president asked me to prepare two statements for him, one if the treaty was ratified, the second if the treaty failed.”

Dr. Pastor further recalled that, on his advice, Brzezinski arranged for the U.S. military to send F-16s to Panama in case of violence resulting from an eventual rejection of the plan. But the treaty passed, initiating the transfer of power that culminated in 1999 with Panama assuming control of the canal.

Dr. Pastor continued working with Carter long after the president had left office, becoming founding director of the Latin American and Caribbean program at the nonprofit Carter Center, in Atlanta. He helped organize the missions abroad that helped define Carter’s post-presidency, traveling with him.

Dr. Pastor was particularly involved in Haitian affairs, including monitoring the election in 1990 of President Jean-Bertrand Aristide. In 1994, Dr. Pastor traveled to Haiti with Carter, Sen. Sam Nunn (D-Ga.) and retired Gen. Colin Powell, the former chairman of the Joint Chiefs of Staff, on the mission that ultimately reinstated Aristide after a military coup.

Speaking before the Senate, Nunn said that Dr. Pastor was an “unsung hero” who deserved “a large measure of credit for the agreement we reached.”

Robert Alan Pastor was born April 10, 1947, in Newark and was a 1969 history graduate of Lafayette College in Easton, Pa. After Peace Corps service in Malaysia, he received a master’s in public administration in 1974 and a doctorate in government in 1977, both from Harvard University. He wrote and edited numerous books, including “A Century’s Journey: How the Great Powers Shape the World” (1999).

In 1994, President Bill Clinton nominated Dr. Pastor for the post of U.S. ambassador to Panama. The nomination was blocked by Sen. Jesse Helms (N.C.), the top Republican on the Senate Foreign Relations Committee, who had strongly disagreed with the Panama Canal treaties.

In academia, Dr. Pastor held leadership and teaching positions at Emory University in Atlanta, Harvard University and, most recently, American University, where he taught international relations and led numerous international programs and initiatives.

Survivors include his wife of 34 years, Margaret “Margy” McNamara Pastor, the daughter of former defense secretary Robert S. McNamara, of Washington; two children, Kip Pastor of Los Angeles and Tiffin Pastor Eisenberg of New York; two brothers; and a grandson.

Carter said in a statement after Dr. Pastor’s death that “because of his vision, boundless energy, and political skill, the Western Hemisphere is more democratic and developed today.”

At times, Dr. Pastor aided the former president with unexpected, practical problems. In 1989, he reportedly shepherded a New York Times reporter out of a Caracas, Venezuela, hotel room so that Carter could have a long-sought, secret and — as it happened — spontaneous meeting with Cuban leader Fidel Castro.

“I almost picked her up and walked her to the elevator to get her out of there in time,” Dr. Pastor told Time magazine. “And 10 seconds later Castro burst into the room.”