Mr. Awoonor published novels and books of verse, including poems like “Songs of Sorrow” that were required reading for several generations of Ghanaian schoolchildren. He was his country’s ambassador to the United Nations in the early 1990s, taught at universities in the United States and Ghana, knew W. E. B. DuBois, and was president of Ghana’s Council of State, a governmental advisory body. News reports in Ghana said he had been invited to a conference in Nairobi and had gone to the mall to have breakfast with his son, who was wounded in the attack.

“He had a huge influence on Ghanaian poetry and Ghanaian academia,” said Akwasi Aidoo, a Ghanaian who is executive director of TrustAfrica, a pan-African good-governance foundation, who knew Mr. Awoonor for nearly 40 years. “He was one of the first poets after Ghanaian independence.”

Because Mr. Awoonor was imprisoned for his activism during a time of repression in the mid-1970s, “we saw him more as an organic intellectual, as somebody who was not just confined to academia, somebody interested in the broader economic and social struggle,” Mr. Aidoo said.