Ketumile Masire was a cattle herder turned statesman who, as President of Botswana between 1980 and 1998, helped to solidify his country’s standing as one of the most thriving nations in Africa.

Masire was widely heralded as a model leader in a model nation on a continent where poverty, corruption and violence had crushed the hopes of many for stability and prosperity.

“We have seen the promise of a new Africa whose roots are deep here in your soil, for you have been an inspiration to all who cherish freedom,” Bill Clinton told Masire during a visit to Gaborone in 1998. The US President noted that in 1966 when Botswana – then known as Bechuanaland – became independent from Britain, it had two miles of paved roads and a single public secondary school. Its chief export was beef.

The discovery of diamond reserves transformed the country’s prospects, and under Masire and his predecessor, Seretse Khama, the nation used its revenue to build roads and schools, improve healthcare and expand access to clean water, advancing farming techniques and extending life spans.

Masire, who described himself as “a farmer who has been drawn into politics”, was credited with leading his landlocked nation through a drought that dragged on for much of the 1980s. In 1989, he shared the Africa Prize for Leadership, awarded by the charitable organisation the Hunger Project in recognition of the food distribution efforts that helped the country avoid starvation during the crisis.

He navigated a delicate relationship with South Africa, Botswana’s neighbour to the south. While South Africa was Botswana’s major economic partner, Botswana opposed apartheid. “He had to walk a line in a really rough neighbourhood,” said Chester Crocker, a former US assistant secretary of state for African affairs. “He had to get along with everybody, without sacrificing his principles.”

While many other African nations suffered under dictatorship, Botswana featured a robust democracy with little, if any, noticeable corruption. The “political inclusivity” Masire fostered, Crocker said, “is a magic formula, and it’s too rare in Africa and elsewhere.”

The stability of Botswana allowed its tourism industry to flourish in times of economic prosperity, with many visitors coming to witness its wildlife.

Masire – often known as Quett – was born in Kanye, in southern Botswana near the South African border, in 1925. He was a herder before enrolling in a primary school at 13.

Crocker said Masire worked the land in a country that may go years without rain and learned a profound sense of self-reliance. He received a scholarship to attend a secondary school in South Africa that trained many leaders of the first government of independent Botswana.

After his parents died when he was in his early twenties, he suspended his education to become a teacher to support his siblings. He was a headmaster before saving enough money to buy a tractor and pursue farming, distinguishing himself with modern agricultural techniques.

He also worked as a journalist, which along with his community involvement helped draw him into politics. He served on tribal and regional councils and was a founder and secretary-general of the Botswana Democratic Party, now the country’s dominant political party. He once traversed 3,000 miles of the Kalahari desert to attend two dozen meetings over two weeks.

Before becoming President, Masire served in roles including minister of finance and development planning and Vice President. After leaving office, he advised other African leaders and chaired an international panel that investigated the Rwandan genocide of 1994. He made important contributions to peace efforts in Congo and, more recently, Mozambique.

In retirement, Masire established the Sir Ketumile Masire Foundation, which seeks to improve agriculture, governance and children’s health in the region. He also tended the cattle on his ranch. Masire married Gladys Olebile Molefi in 1958; she died in 2013. They had six children.

“We have a saying in Botswana: A man is never strong until he says what he believes and gives other men the chance to do the same,” he once said. “I am proud to say without a doubt – we are a strong democracy.”

Ketumile Masire, politician, born 23 July 1925, died 22 June 2017