Diego Cordovez, then the U.N. Secretary General’s special adviser for Cyprus, addresses the media in 1998. (Philip Mark/AP)

Diego Cordovez, an abidingly patient U.N. diplomat who coaxed — from warring parties who would not speak to each other — a series of agreements that led to the Soviet Union’s withdrawal of troops from Afghanistan in the late 1980s, died May 24 in Quito, Ecuador. He was 78.

His death was announced in a statement by a spokesman for U.N. Secretary-General Ban Ki-moon. No cause was cited.

Born in Ecuador and trained as a lawyer, Mr. Cordovez joined the staff of the United Nations in his late 20s and contributed to the resolution, or attempted resolution, of crises around the world.

He was best known for his role as a U.N. under-secretary-general for political affairs during the conflict in Afghanistan, which pitted the Soviet-backed Kabul government against insurgent Muslim mujahideen, who received support from the United States.

One of the final proxy battles of the Cold War, it was a brutal conflict that, according to estimates at the time, killed one in 15 Afghans and forced one out of three from the country.

Mr. Cordovez was credited with deploying his considerable forbearance, an irresistible sense of humor and a more than occasional cigar to achieve a successful end to the negotiations.

From the outset, he faced a daunting task. Initially the Soviets, who had invaded Afghanistan in 1979 and maintained 115,000 troops in the country, rejected U.N. brokerage of a peace agreement. Afghan guerrillas refused to negotiate with the Kabul government. Pakistan, which was dispatched to represent the guerrillas, was similarly opposed to face-to-face talks.

Mr. Cordovez approached the problem by first dealing separately with the various sides. He gradually moved the adversaries closer to each other — first literally, then diplomatically — by placing their representatives in separate but nearby rooms at the Palais des Nations in Geneva and scurrying back and forth.

Mr. Cordovez also dashed to and from Afghanistan, Pakistan, the Soviet Union and the United States. He did not take notes during his meetings — “so that nobody could pin [me] down,” he told The Washington Post.

At times, the talks assumed comical qualities. Guards who had been ordered to keep the parties away from each other reportedly locked representatives in bathrooms to prevent unplanned encounters.

When the negotiations seemed unpromising, Mr. Cordovez affected a labored gait — a message to observers that the process was still limping along.

“It has happened that everybody has given up except myself,” Mr. Cordovez told an interviewer. “Not to give up was my duty.”

The Geneva agreements that provided for the Soviet pullout were signed in 1988 by Afghanistan, Pakistan, the Soviet Union and the United States. Although the accords were regarded as a monumental achievement, Afghanistan continued to confront persistent internal tumult.

Two years after the agreement, Mr. Cordovez wrote in a commentary for The Post that during the negotiations, “American and Pakistani officials expressed absolute conviction that the key was the Soviet withdrawal and that after it was completed ‘everything else would fall into place.’ ”

He continued, “This has unfortunately not happened yet.”

Diego Cordovez Zegers was born Nov. 3, 1935, in Quito. (He was known for his forthrightness and once called a special media conference to remind reporters: “My name is not spelled with an accent over the ‘o,’ and if a newspaper keeps misspelling it, I will cease buying it.”)

Mr. Cordovez received degrees in political science and law from the University of Chile. In the early years of his U.N. career, he served on missions in the Dominican Republic during bloody conflict in 1965 and in the newly established nation of Bangladesh in the early 1970s.

He participated in U.N. involvement in the Iran-Iraq war in the 1980s and in the international body’s unsuccessful efforts to end the Iran hostage crisis that began in 1979.

In 1988, Mr. Cordovez left the United Nations to serve as Ecuador’s foreign minister. He later was his country’s ambassador to the United Nations. With foreign affairs scholar Selig S. Harrison, he wrote, “Out of Afghanistan: The Inside Story of the Soviet Withdrawal” (1995).

Mr. Cordovez and his wife, Maria Teresa Somavia, had a son, Diego Cordovez. A complete list of survivors could not immediately be confirmed.

Mr. Cordovez said that, as a negotiator, he was always “brutally honest” with his participants.

“In this game,” he said, “the only way you’re safe is to tell the truth.”