When Tanzanian voters went to the polls on October 28, the incumbent President John Pombe Magufuli and his party Chama Cha Mapinduzi showed all the signs of being confident about victory. This confidence resulted from the way in which Magufuli has governed Tanzania since he assumed office in October 2015.
His style has been one of intolerance, populism and a no-nonsense 'bulldozer' attitude. He pursued this approach in the run up to the elections too, effectively fencing off the opposition.
By the day of the poll, the opposition, civil society groups, and the media no longer had any confidence in the electoral process. This was not surprising given how heavily the process had been compromised. The electoral process itself lacked the values that determine the credibility of elections.
The election results, announced by the National Electoral Commission on Friday evening, gave the president 84% of the vote and the opposition leader Tundu Lissu 13%.
But the poll could not be said to have passed the credibility test. Nor can it be said to have passed the free and fair test.
Broken electoral system
The electoral process undermined electoral credibility in a range of ways.
Firstly, there was extensive harassment of opposition politicians. Some were arrested on fake charges and there were cases of alleged murder.
Secondly, the government constrained the space for the opposition, civil society groups and the media. Throughout the election period, the government made it difficult for the opposition to organise rallies. It arrested critics in civil society and the media. It also cowed the media by enforcing regulations that saw several media outlets barred from communicating anything for extended periods of time.
On top of that, as voting began, the government clamped down on use of social media and closed down the internet. The aim was clearly to frustrate two groups in particular - young people and those living in urban areas. In both, support for the opposition overwhelms the ruling party.
This action, in particular, made people draw parallels with neighbouring countries such as Uganda.
Thirdly, the electoral commission showed open bias towards the ruling party candidate in interpreting the law. The electoral commission even barred opposition leaders from campaigning.
The commission also sought to intimidate the opposition by not receiving their eligibility documents on unsubstantiated grounds.
The government also used the commission to win some seats in advance of the election. By the time of closing the general election candidates' list, 28 Members of Parliament - or 11% of MPs, all from the ruling party - had been elected unopposed. The commission did this by disqualifying opponents on the grounds that they didn't meet the legal threshold. The conditions were, however, applied stringently to opposition candidates only.
Finally, the electoral commission refused to accredit reputable election observer groups. Only groups allied to those in the ruling party or in government acquired the permission to observe and monitor the election.
Pressing all the right buttons
Why did President Magufuli shape the electoral process in this way? And what will be the consequences?
The answer lies in the fact that he came from a weak base.
Five years ago he secured a victory with only 58% of the vote. This was a markedly poor performance for the party that had ruled the country since independence in 1961. In 2005, for example, his predecessor and ruling party candidate Jakaya Kikwete garnered 80.28% of the vote.
An additional factor is that Magufuli, though a cabinet minister before he was picked to run for the presidency in 2015, was not a strong party insider. It was former president Benjamin Mkapa who pushed him to the centre as a contender of internal Chama cha Mapinduzi politics.
Without roots in the party, Magufuli had to cultivate a platform on which to launch his identity and endear himself to Tanzanians. He chose populist appeals. This included a commitment to clamp down on corruption. And he chose to fight the big corporations as well as the rich. He told off donors too.
Magufuli combined this approach with picking on what Tanzanian elites like most - a regional fight. He chose a fight with Kenya by, for example, confiscating and selling cattle that crossed the border.
He also focused on provision of big infrastructure to show that Tanzania was developing.
But it is his approach to public administration that endeared him to voters. He drove into the countryside to solve petty problems that ordinary people faced. This strategy worked - his popularity rose in rural areas.
There was, however, another side to the president. While presenting himself as a populist, Magufuli adopted a repressive approach, perhaps convinced that ordinary people were behind him.
A divided country
Under Magafuli's presidency the opposition increasingly identified lack of freedoms, democratic space and rights as new challenges in the country. This language of rights and freedoms became effective in mobilising urban voters.
Voters were presented with two competing and highly divisive issues. The opposition presented the language of democracy - specifically rights and freedoms - as the foundation for change and a better future. Magufuli presented the language of populism in service delivery. But where populism didn't work, Magufuli used repression to ensure critics weren't heard.
These competing approaches have left Tanzania a highly polarised society. The country is politically fragile. The party that established the fabric for peace, stability and national cohesion is now the party known to have sown dissent.
Magufuli went to extraordinary lengths to win a second term. He will certainly entertain the thought of changing the term limit so that he can have more. He has numbers in parliament to get his way. He has already intensified repression and silenced various groups that would have opposed him. Tanzania is slowly walking the path that others in the region have walked before; a path that leads to absolute authoritarianism.