Botswana President Mokgweetsi Masisi votes in Botswana's general elections in Moshupa, some 45kms (30 miles) west of Gaborone. Picture: Jerome Delay/AP

Gaborone - Counting was under way in Botswana on Wednesday after peaceful parliamentary elections that represented a showdown between the country's current president and its former leader.

The Botswana Democratic Party (BDP) has ruled the southern African country since independence from Britain in 1966, overseeing its rise from one of the world's poorest nations to a middle-income country thanks to diamond production.

But the party has had to contend with the defection earlier this year of the country's former long-time leader Ian Khama, who was succeeded as president in 2018 by Mokgweetsi Masisi.

The two men have since had a falling-out, with Masisi reversing several policies that were dear to Khama's heart, for instance a ban on elephant hunting. Khama has created an opposition party, the Botswana Patriotic Front, to contest the elections.

Masisi nevertheless was confident of achieving victory.

"It's as automatic as the sun rising in the east and setting in the west. We're going to win," he told journalists after casting his vote on Wednesday.

In an interview with South African news outlet EWN, Khama accused Masisi of failing to carry on the BDP legacy of using Botswana's national resources for "the development of the people and the nation at large" and having "very strong democratic credentials."

"We've just seen somebody who became drunk on power, falling into that power trap that we've seen happen in ... some other African countries," he said. "It's just astonishing."

Botswana has long been considered one of Africa's most stable democracies. The diamond-rich country has, however, also struggled with high unemployment, which official records peg at 17 per cent, but opposition parties believe is higher.

Diamond mining does not create that many jobs, so "inequality is pretty high," says Keith Jefferis of the Econsult Botswana research organization. The challenge for the new government will be to move from diamond-led growth to diversified exports, he predicted.

Fifty-seven constituencies are contested in the elections, with just under 925,500 people registered to vote. The Botswana parliament elects the country's president.

Preliminary results are expected to be released on Thursday.