Harry J. Gilmore, a veteran Foreign Service officer who was the first U.S. ambassador to the newly independent country of Armenia and earlier was a senior diplomat in West Berlin when the Berlin Wall came down in 1989, died April 23 at a hospital in Alexandria. He was 77.

The cause was a heart attack, said his wife, Carol Gilmore.

Mr. Gilmore spent 36 years as a Foreign Service officer and retired in 1997 as dean of the senior seminar at the Foreign Service Institute. He was ambassador to Armenia from 1993 to 1995, soon after the collapse of the Soviet Union.

In the capital city of Yerevan, he was chief of mission to an impoverished nation with meager food resources and scant heating supplies. He ordered that money allocated for embassy social events be spent on food and fuel to assist a cold and starving population.

As U.S. minister in West Berlin, Mr. Gilmore was also the deputy commandant of the American sector.

A1994 photo of ambassador Harry Gilmore in his office in Yerevan, Armenia. (Courtesy of Armenian Embassy)

On the night of Nov. 9, 1989, he was called in the latter capacity by the mayor of West Berlin, who was seeking authority to deploy West German police at the Berlin Wall to control thousands of East Berliners who were massing at the East-West checkpoints.

In the months before that night, “there had been a steady crescendo of peaceful and increasingly massive demonstrations for freedom in East Germany, especially freedom of travel,” Mr. Gilmore wrote in a Baltimore Sun commentary in 2004.

Then on Nov. 9, an East German government spokesman made an ambiguous media statement. It appeared to grant permission for East Germans under Soviet control to cross into West Berlin.

“Because of the acute political sensitivity of West German police encroaching or crossing the sector boundary, I should have consulted our British and French allies and higher U.S. authority before responding,” Mr. Gilmore wrote in the Sun. “But this would have taken far too much time.”

So he granted the mayor’s request on the spot.

“Within minutes we had given police the flexibility they needed to establish order at the wall. Amid the teeming, surging crowds, no one was seriously injured at the wall that night,” he wrote.

Harry Joseph Gilmore, a resident of Dumfries, Va., was born on Nov. 16, 1937, in McKeesport, Pa. He graduated in 1960 from the University of Pittsburgh and went on to do graduate work in Russian and East German studies.

His early Foreign Service assignments included Belgrade, in the former Yugoslavia; Munich; Moscow; Budapest; and Ankara, Turkey.

After retiring from the Foreign Service, Mr. Gilmore was chairman for Caucasus-area studies at the State Department’s National Foreign Affairs Training Center. His honors include two State Department Superior Honor Awards.

Mr. Gilmore was a pianist and his wife a professional singer. On several European assignments, they performed together, presenting shows on American musical culture.

Survivors include his wife of 54 years, Carol Kunz Gilmore of Dumfries; a son, Joe Gilmore of Arlington; a brother; a sister; and five grandchildren. Two of his children died, Greg Gilmore in 2009 and Wendy Gilmore in 2014.

A critical component of Mr. Gilmore’s service as ambassador to Armenia was oversight of a massive aid and relief program.

He received a letter once from a little girl who wrote that she had never seen or tasted a banana. He arranged for the air delivery of bananas from Germany, invited her to the embassy, and gave her a packet of bananas.