Ketumile Masire, who as president of Botswana for nearly two decades helped transform his arid and destitute country into the envy of other African nations, died on June 22 in Gaborone, the capital city. He was 91.

His death, at a hospital where he had been taken for surgery on June 16, was announced in a statement by his family.

Mr. Masire (pronounced ma-SEE-ray) was an architect of Botswana’s government after the southern African country gained independence from Britain in 1966, working alongside Seretse Khama, the country’s first president. Mr. Masire succeeded Mr. Khama, who died of cancer in 1980, and he was elected in 1984, 1989 and 1994, serving until 1998.

At the time of its independence, Botswana was listed by the United Nations as one of the world’s least developed nations, with little running water or electricity, few paved roads and no public high schools. Beef was virtually the only export.