The southern African nation's electoral commission said President Hage Geingob led with 57% of the vote while opposition challenger Dr. Panduleni Itula had 28%. Itula made history as the first independent candidate for the presidency, though he retained his ruling party membership.
The results showed a sharp decrease in support for Geingob from 87% in the previous election in 2014. Public frustration has been high over corruption scandals and unemployment.
"I wish to thank Namibians for re-electing me as their president," Geingob said on social media.
The ruling SWAPO party, which has been in power since independence from South Africa in 1990, led with 66% of the vote in the National Assembly race while the Popular Democratic Movement had gained seats with 15%. The percentages are roughly equal to the number of seats won. SWAPO won 77 seats in the previous election.
Some 1.3 million voters were registered for Wednesday's election. The electoral commission as of Saturday afternoon said it had recorded less than 800,000 votes.
While troubles were reported with some electronic voting machines, a preliminary statement by observer missions called the election free, fair and "generally peaceful." It said 62% of polling stations opened on time.
Some Namibians expressed frustration over what they considered the slow pace of vote-counting.
"The counting, accuracy and verification process leave us more confused. One would think that the reason why we opted for (electronic voting machines) is for the purposes of effectiveness and efficiency," political analyst Ndumba Kamwanyah said. "But that really is turning out to be the opposite. It seems we haven't quite mastered how to use those voting machines to our advantage."
The ruling SWAPO shortly before the election was shaken by corruption allegations linked to fishing quotas that led two cabinet ministers to resign.