Stephen W. Bosworth in Seoul in 2009. (Choi Bu-Seok/Reuters)

Stephen W. Bosworth, a three-time U.S. ambassador who helped shepherd the transition to democracy in the Philippines after the decades-long rule of Ferdinand E. Marcos and later sought to defuse the nuclear threat in North Korea, died Jan. 4 at his home in Boston. He was 76.

The cause was pancreatic cancer, said his brother Brian Bosworth.

At the time of his death, Mr. Bosworth was chairman of the U.S.-Korea Institute at the Paul H. Nitze School of Advanced International Studies at Johns Hopkins University. From 2001 to 2013, he had served as dean of the Fletcher School of Law and Diplomacy at Tufts University in Medford, Mass.

He had amassed half a century’s experience in diplomacy, beginning when he joined the Foreign Service in 1961, and became particularly sought-after for his expertise on the Korean peninsula.

He served under President Bill Clinton as U.S. ambassador to South Korea, a principal U.S. ally in Asia, and under President Obama as special envoy to North Korea, the Stalinist dictatorship that announced this week, in a claim doubted by many nuclear experts, that it had tested a hydrogen bomb.

In a statement, Secretary of State John F. Kerry described Mr. Bosworth as “one of our nation’s most capable and admired diplomats.”

Mr. Bosworth rose through the State Department ranks as an economics officer and assumed his first ambassadorial appointment, in Tunisia, in 1979. Not yet 40 years old, he was “one of the youngest career diplomats ever appointed to an ambassadorship in American history,” according to the New York Times.

He spent two years in Tunisia before being persuaded by George P. Shultz, secretary of state under President Ronald Reagan, to accept the ambassadorship to the Philippines in 1984.

Mr. Bosworth’s tenure there coincided with the “people power revolution” that overthrew Marcos in 1986, making way for the democratic leadership of Corazon Aquino. The ambassador was intimately involved in that transition of power, coordinating with officials in Washington and with the beleaguered Filipino leader as he made an agonized decision to step down.

Mr. Bosworth informed U.S. leaders that “Marcos will not draw the conclusion that he must leave unless President Reagan puts it to him directly,” the reporter Stanley Karnow wrote in a book-length account of those events. He was credited with helping effectively manage Marcos’s exit — including the helicopter that flew him and his wife, Imelda, out of Manila.

Mr. Bosworth left the Philippines in 1987 and became president of the United States-Japan Foundation, a grant-making institution, for nearly a decade.

But he remained active in diplomacy as executive director of the Korean Peninsula Energy Development Organization, a group created to help implement an ill-fated 1994 agreement between the United States and North Korea in which Pyongyang agreed to end its nuclear weapons program in exchange for infusions of fuel and the construction of two nuclear power plants.

Mr. Bosworth served as ambassador to South Korea from 1997 to 2001 and then as special representative for North Korea from 2009 to 2011, an experience that made him one of the relatively few outsiders with first-hand experience of the Communist country.

“It’s very deceptive to try to describe North Korea because you see what they want you to see,” he once told the Boston Globe. “You don’t wander the streets and have coffee in a sidewalk cafe. It’s a very closed, regimented society.”

The 1994 agreement with North Korea disintegrated amid violations by Pyongyang and worsening relations with the United States, but Mr. Bosworth remained an ardent supporter of communications with North Korea. As recently as last year, he met with a North Korean official about resuming denuclearization talks.

“Much of diplomacy is rewarding bad behavior,” Mr. Bosworth once remarked on the PBS program “Frontline,” responding to critics who argued against meeting with North Korea. “You’re trying to figure out how you can stop the worst of the behavior at the lowest-possible price.”

Stephen Warren Bosworth was born Dec. 4, 1939, in Grand Rapids, Mich., where he grew up on a farm.

He received a bachelor’s degree in international relations from Dartmouth College in 1961, then joined the Foreign Service. He had early posts in Panama, Spain and France and served at the State Department headquarters in posts including director of policy planning.

His publications included “Chasing the Sun: Rethinking East Asian Policy” (2006), a book written with Morton Abramowitz, former ambassador to Thailand and Turkey.

His first marriage, to Sandra De Puit, ended in divorce.

Survivors include his wife of 31 years, the former Christine Holmes of Boston; two children from his first marriage, Allison Bosworth of Rochester, N.Y., and Andrew Bosworth of Chengdu, China; two stepchildren, William Rutledge of Scituate, Mass., and Stacey Rutledge of Tallahassee; two brothers, Barry Bosworth of Silver Spring, Md., and Brian Bosworth of New York City; and 10 grandchildren.

In 2006, speaking at the U.S.-Korea Institute shortly before North Korea announced its first nuclear test, Mr. Bosworth remarked that “you can say a lot of things about North Korea, most of them bad, but one reality is they will not go gently into that dark night.”

This week, Jang Il Hun, North Korea’s ambassador to the United Nations, offered his condolences for Mr. Bosworth’s death.

He was “an outstanding diplomat and a man of great personality and vision, advocating for dialogue, not confrontation” with North Korea, Jang said in a statement reported by the website “I personally miss him very much.”