W. Kennedy Cromwell III, 88, a retired Foreign Service officer who specialized in African affairs, died Dec. 13 at the Fairhaven retirement community in Sykesville, Md., after a heart attack.

His son Francis M. Cromwell confirmed the death.

Mr. Cromwell joined the State Department in 1949.

After postings in Portugal, Nigeria and Angola, he worked in Uganda assisting in that country’s transition from British rule in the early 1960s. In so doing, his family said, Mr. Cromwell worked with Ugandan army chief Idi Amin, who later became the country’s dictator and an international pariah.

In the early 1970s, Mr. Cromwell was chargé d’affaires in Bots­wana and deputy chief of mission in Somalia.

Mr. Cromwell ended his diplomatic career in 1980 as foreign policy adviser to the Coast Guard commandant. He helped negotiate and strengthen drug interdiction and search and rescue agreements with countries throughout Asia and Latin America, his family said.

William Kennedy Cromwell III was born in Baltimore and served in the Army during World War II. He was a 1948 graduate of Grinnell College in Iowa and the next year received a master’s degree in international affairs from Johns Hopkins University’s School of Advanced International Studies in Washington.

Mr. Cromwell received the Coast Guard’s Distinguished Public Service Award and the State Department’s Superior Honor Award.

The former Annapolis resident lived most recently in Sykesville.

His first wife, the former Ceceile Murphy, died in 1983 after 25 years of marriage. A second marriage, to Martha Atkinson, ended in divorce.

Survivors include two sons from the first marriage, William K. Cromwell IV of Alexandria and Francis M. Cromwell of Olney; a brother; two sisters; and two grandchildren.

— Adam Bernstein