Polls opened in Botswana on Wednesday as the long-peaceful southern African nation faces what is expected to be its tightest election in history.

The ruling party and President Mokgweetsi Masisi have been presented with a surprising challenge after former President Ian Khama broke away and announced his support for an opposition coalition instead.

Khama hand-picked Masisi as his successor when he stepped down last year following two terms in office in the diamond-rich country. But Masisi then moved away from some of Khama's policies, including by loosening restrictions on elephant hunting to appeal to rural voters.

People line up to vote in Botswana's general elections at the Masa primary school in Gaborone Wednesday, Oct. 23, 2019. Polls opened in Botswana on Wednesday as the long-peaceful southern African nation faces what is expected to be its tightest election in history. (AP PhotoJerome Delay)

People line up to vote in Botswana's general elections at the Masa primary school in Gaborone Wednesday, Oct. 23, 2019. Polls opened in Botswana on Wednesday as the long-peaceful southern African nation faces what is expected to be its tightest election in history. (AP PhotoJerome Delay)

Opposition leaders say their coalition could unseat the ruling party for the first time since independence in 1966. Khama has openly supported the opposition coalition Umbrella for Democratic Change and its presidential candidate, human rights lawyer Duma Boko.

The election could hinge on whether people support Khama's move. Some in Botswana have criticized the former president's rejection of his own party and suggested that he is trying to extend his influence.

Botswana, with 925,000 registered voters in a population of 2.2 million, is one of Africa's most stable countries.

People line up to vote in Botswana's general elections at the Masa primary school in Gaborone Wednesday, Oct. 23, 2019. Polls opened in Botswana on Wednesday as the long-peaceful southern African nation faces what is expected to be its tightest election in history. (AP PhotoJerome Delay)

People line up to vote in Botswana's general elections at the Masa primary school in Gaborone Wednesday, Oct. 23, 2019. Polls opened in Botswana on Wednesday as the long-peaceful southern African nation faces what is expected to be its tightest election in history. (AP PhotoJerome Delay)

"There is an environment of peace and tranquility prevailing," Sibusiso Moyo, the Zimbabwean head of the Southern African Development Community election observation mission, said Tuesday.

Botswana's president earlier this month said he would accept an election loss, while opposition leader Boko was noncommittal.

Botswana is voting for members of the National Assembly, who will then choose the president. There is no runoff election.

People line up to vote in Botswana's general elections at the Masa primary school in Gaborone Wednesday, Oct. 23, 2019. Polls opened in Botswana on Wednesday as the long-peaceful southern African nation faces what is expected to be its tightest election in history. (AP PhotoJerome Delay)

People line up to vote in Botswana's general elections at the Masa primary school in Gaborone Wednesday, Oct. 23, 2019. Polls opened in Botswana on Wednesday as the long-peaceful southern African nation faces what is expected to be its tightest election in history. (AP PhotoJerome Delay)

Election results are expected to be released within two days of the closing of the polls Wednesday evening.

Follow Africa news at https://twitter.com/AP_Africa