In less than a year, Kazakhstan's President Kassym-Jomart Tokayev violently suppressed the worst unrest in his country's history, neutralised his all-powerful predecessor and stood up to Russia's Vladimir Putin.
Few expect surprises in the vast Central Asian country's polls on Sunday, with Tokayev's victory all but a foregone conclusion.
The 69-year-old is facing no real opposition candidates in the former Soviet country where critics are sidelined and all five of his competitors are virtually unknown.
When he took over in 2019, the veteran diplomat expected to rule in the shadow and at the behest of his predecessor and mentor: Nursultan Nazarbayev, who had ruled since 1991.
Nazarbayev, who presided over Kazakhstan's independence from the Soviet Union, retained the title of "Elbasy" -- the "head of the nation" in the Kazakh language.
This gave him huge influence over politics and his clan retained control over the energy-rich country's economy.
- Shoot to kill -
For two and a half years, Tokayev -- a steady hand known for lacking charisma -- played the role of a loyal successor.
That changed in January.
Protests broke out across the vast country that turned into violent unrest and centred on Kazakhstan's economic centre, Almaty.
Tokayev showed a ruthless side, ordering law enforcement to "shoot to kill" demonstrators. He also cut off communication with the outside world and called on Moscow to send troops to help.
The deployment of Moscow-led "peacekeeping" forces suppressed the uprising, which some observers believed might have brought about Tokayev's fall.
The chaos ended with 238 dead in nine days.
Determined to cement his authority, Tokayev promptly told Putin that Russian soldiers must leave.
And in a surprise move, he broke with his mentor Nazarbayev, purging his clan from positions of authority and promising a "new and just Kazakhstan".
The octogenarian ex-leader was deprived of his powers, some relatives were imprisoned and he was forced to publicly swear allegiance to Tokayev.
In the process, the new leader announced reforms, a constitutional referendum and introduced single presidential terms of seven years, triggering an early ballot on November 20.
In a final nail driven into the coffin of the Nazarbayev era, the capital city -- renamed in the dictator's honour in 2019 -- regained its name of Astana in September this year.
Despite Tokayev purging Nazarbayev, the overhaul represents the liberalisation of an authoritarian state.
- 'I am no dreamer' -
"I am no utopian or a dreamer," Tokayev said in June.
A veteran civil servant, he has served as foreign minister, prime minister and senate head.
Amirzhan Kosanov, Tokayev's main rival from the 2019 presidential election, said the Kazakh leader remains a pure product of his predecessor's regime.
"The shadow of Nazarbayev still hangs over Mr. Tokayev," he told AFP.
He did not rule out a repeat of the January 2022 chaos, given how widespread poverty and corruption is in the country.
"History has prepared an unenviable fate for him: he must clean the Augean stables," he said, borrowing from Greek mythology to describe a necessary clean-up of graft and the economy.
The veteran diplomat -- fluent in Chinese and English -- has not only neutralised his political mentor.
He has also had to keep Kazakhstan's old master, the Kremlin, at a distance.
Putin's invasion of Ukraine has reawakened Kazakh concerns that Moscow may have ambitions on the north of the country, home to around three million ethnic Russians.
Kazakhstan and Russia share a 7,500-kilometre-long (about 4,660-mile) border.
Tokayev publicly clashed with Putin on a visit to Saint Petersburg in June, criticising Moscow's move to recognise Ukrainian separatist regions that it has since claimed to annex.
Sitting next to the Kremlin chief, Tokayev said that recognising separatist authorities around the world would "lead to chaos."
Four months later, when Putin announced the mobilisation of tens of thousands of reservists, Tokayev opened the borders and welcomed a flood of Russians fleeing the army.
He called on Kazakhs to "take care of them and ensure their security".
Despite the January unrest, Tokayev is far from internationally isolated and has received a string of visitors this year -- from EU chief Charles Michel to Pope Francis.
China's Xi Jinping also made his first post-pandemic trip to Kazakhstan.
Even his rival Kosanov acknowledged that Tokayev's "foreign policy is a success".