Namibians on Wednesday voted for a president and lawmakers in an election where resentment stoked by economic hardships and a corruption scandal could challenge the ruling party's majority.

Polling stations opened at seven am in the sparsely populated nation which has been ruled by the South West Africa People's Organisation (SWAPO) since independence from South Africa in 1990.

President Hage Geingob is vying for re-election after his first term was marred by a recession that stirred anger against SWAPO.

He was the first to vote at Mandume primary school in the capital Windhoek.

‘Let (Namibians) come out and peacefully participate in their democratic right,’ Geingob told reporters.

While the incumbent was confident of victory, he promised to accept defeat.

‘This is not the war, this is not the end of the world. We are just exercising our democratic right,’ he added.

SWAPO continues to bask in the legacy of the liberation struggle in the mineral-rich country where the Namib desert stretches along 1,500 kilometres (930 miles) of Atlantic coastline.

However a SWAPO member standing as Namibia's first independent candidate, ex-dentist Panduleni Itula, 62, has rallied support among jobless young people.

Geingob is widely expected to win, but not with the 87 percent of votes he garnered in 2014.

- Electronic suspicions -

In Katutura, an impoverished Windhoek suburb, long lines of people stood under the scorching sun waiting to vote.

Namibia was the first country in Africa to introduce electronic voting machines (EVMs) in 2014.

The machines -- meant to speed up voting -- have come under opposition fire with claims the absence of paper records raises prospects of fraud.

But the electoral tribunal threw out an application by Itula to bar the use of EVMs, which he unsuccessfully appealed on Tuesday.

‘The EVM machines are easier and more comfortable to use,’ said Selma Nangolo, 34, after voting in Katutura.

Cradling her new-born baby, Nangolo told AFP she was hoping for a new regime to ‘revive our economy and create more employment, especially for the youth.’

- 'Fish rot' -

Geingob's SWAPO-lead government took another hit this month when Wikileaks released documents alleging corruption in the fishing industry -- the country's second most important after mining.

The ‘fish rot’ files suggest government officials took bribes from an Icelandic firm in exchange for continued access to Namibia's fishing grounds.

Two ministers resigned over the scandal, which allegedly involved 150 million Namibian dollars (US$10 million, 9.1 million euros). The ex-fisheries minister was briefly detained over the weekend.

Geingob has denied any involvement and said the timing was intended to damage his campaign.

- Inequality -

In Windhoek, where corrugated iron houses sprawl the outskirts, indignation against the government is rife.

Around 40 percent of urban dwellers live in shacks, according to official figures for 2016.

Resource-rich Namibia is the world's second most unequal country after neighbouring South Africa, according to the World Bank.

The president has also come under fire for pumping money into a bloated administration and granting contracts to foreign companies rather than boosting the local economy.

‘We want to remove corruption out of our society so that everyone must have a little share from the resources we have in our country,’ 40-year old pastor John Nanub told AFP.

‘If we get the chance to vote we will make sure to choose the right people who can bring change,’ he added.

- 'Neck to neck' -

But analysts believe the opposition remains too weak and ethnically divided to put up a credible fight.

SWAPO's historic challenger, the Popular Democratic Party (PDM), is overshadowed by its affiliation with apartheid South Africa before independence, which continues to deter voters.

‘The result for the presidential election could be neck to neck,’ said PDM candidate and second-time runner McHenry Venaani.

‘Ten years ago I wouldn't have dared voting here, people would have stoned me,’ he told reporters in Katutura after voting.

Venaani came second in 2014 with less than five percent of the vote. Despite doubling its support base, the PDM won only five of 96 seats at the National Assembly.

Meanwhile, SWAPO has enjoyed a two-thirds majority in parliament since 1994.

Around 1.4 million of Namibia's 2.45 million population are registered to vote. Half are younger than 37 and many were born after independence.

Polling is scheduled to close at 9 pm (1900 GMT) across some 4,200 polling stations.

In 2014, results were released the day after polling.