Namibia is undergoing the most contested elections since independence from white-ruled South Africa 34 years ago.
Netumbo Nandi-Ndaitwah is seeking to become the country’s first female president.
She is the candidate of the ruling South West African People’s Organization (Swapo) to replace Hage Geingob, who died in February after nine years in power.
But high unemployment, poverty, inequality and allegations of corruption have weakened support for the party.
Nandi-Ndaitwah’s main challengers are Panduleni Itula and 13 other candidates from the Independence Patriots for Change (IPC) party.
According to local media, long lines had already formed at schools and other polling places when voting began Wednesday morning.
However, there were also reports of ballot shortages at some polling places.
Voting begins at 07:00 local time (GMT) and ends at 21:00.
Swapo has been in power since the country gained independence in 1990.
A candidate needs more than 50% of the vote to win outright. Otherwise, a second runoff election will be held between the top two candidates.
Results are expected in the next few days.
Nandi-Ndayitwa cast her ballot in the capital Windhoek as voting began, urging fellow Namibians to get out and vote, saying “it will affect your lives for the next five years.”
She is speaking out against the country’s traditional, male-dominated political culture.
But she is a trusted leader who has served in high public office for 25 years.
Itula, a former dentist and lawyer, won 29% of the vote in the last election in 2019, losing to Swapo leader Geingob, who won 56%.
Casting his vote in the capital, he said today was an important day for democracy in Namibia.
Namibia is currently led by interim President Nangolo Mbumba, who took office in February after Geingob’s death, but he is not running.
Analysts say the outcome will depend on young voters, who make up more than half of the electorate.
Namibians are also electing new members of parliament.
Namibia is a vast and peaceful country with a sparse population of about 3 million, about half of whom have the right to vote.