But analysts say that as Samia set her eyes on a second term, she started seeing internal party pressure within the CCM and the resurgence of the opposition as threats to her ambition.
For the last three years, she had reshuffled the cabinet multiple times and replaced military and intelligence chiefs, in moves seen as weeding out loyalists of her predecessor.
“Within the CCM, she resorted to a Magufuli script of manipulating the party, centralising power and creating a cabal of trusted loyalists as the new fulcrum of power,” said Prof Kagwanja.
Samia’s calculated political manoeuvres – which earned her the nickname “Simba jike” (Swahili for lioness) among her supporters – paid off as the CCM nominated her as its presidential candidate in January.
Months to the election, a wave of abductions, arrests and the brutal killings of opposition members gripped the country, shattering hopes for reforms and reconciliation.
The political space had drastically shrunk in the run-up to the recent election, that was overshadowed by an internet blackout and a curfew.
Hundreds may have died in post-election unrest according to the opposition. The authorities are yet to release an official death toll.
The violence was shocking for a nation that had cultivated an image of calm, consensus, and order for nearly six decades.
“The myth of Tanzanian exceptionalism lies in ruins,” stated Mr Onyango-Obbo.
In an uncommon critique, the African Union and the regional Southern African Development Community said Samia’s electoral victory did not meet accepted democratic standards, citing ballot-stuffing, repression and systemic flaws.
The main opposition, the Party for Democracy and Development (Chadema), dismissed the results as “completely fabricated”.
“Samia’s challenge was not winning the election. Instead, it was to win the hearts and minds of Tanzanians and East Africans that she was elected in a fair contest. Lamentably, Samia chose coronation. She closed all avenues to a fair contest,” said Prof Kagwanja.
As she begins to serve her second term in office, analysts say Samia is facing mounting international scrutiny which could undermine her legitimacy to lead the East African country.