PRAGUE (Reuters) - Milos Zeman, the longest-standing figure in Czech post-communist politics, won a final major battle on Saturday, showing off his strong political instincts to secure a second presidential term.

Czech President Milos Zeman reacts as he defeated pro-EU academic Jiri Drahos in the presidential election in Prague, Czech Republic, January 27, 2018. REUTERS/Stringer

Zeman, 73, bet on a populist anti-immigration stance and sniping at intellectual Prague elites to mobilize his base and gain a narrow win over Jiri Drahos, a mainstream pro-European academic, in the run-off vote.

A trained economist, Zeman is the last of the heavyweights who shaped the country’s post-1989 history, a trio that includes Vaclav Havel, an anti-communist dissident and later president who died in 2011, and Vaclav Klaus, a former center-right prime minister and president in 2003-2013.

Zeman, once a center-left prime minister, shifted right and picked up the anti-immigration card in 2015 when hundreds of thousands sought refuge in Europe from wars or poverty.

Just as the rise of migration has led to far-right gains across Europe, playing to fears helped Zeman in his re-election as the issue was important to many voters, even though hardly any refugees ever entered the central European country.

“He has not just divided but completely split up society,” said Jiri Priban, a professor of philosophy of law at Cardiff University and a political commentator.

“He forced a feeling upon a successful, safe, stabilized society that it is under threat and must defend itself from imaginary dangers.”

The anti-migration platform has aligned Zeman with the Czech far-right. Tomio Okamura, the head of SPD, an anti-EU and anti-NATO party that won seats in an October general election, flanked Zeman on Saturday.

Zeman, after taking jabs at journalists, backed Okamura’s calls to use more referenda, despite in the past speaking sharply against direct votes.

“Not only journalists but also some politicians possess intelligence that is substantially lower than that of normal citizens,” Zeman told his victory celebration.

“Therefore I wish that these ordinary citizens can decide in referenda as well as in direct elections of mayors and regional governors.”

Zeman supports a referendum on EU membership, although he said he would vote to stay.

A frequent question in the campaign was Zeman’s health. A heavy smoker and self-adverrtised drinker, he has diabetes and difficulty walking due to neuropathy in his legs.

ZEMAN AND KLAUS

After the end of Communism in 1989, Zeman joined the center-left Social Democrats - taking a position on the other side of the political scene from then-prime minister Klaus.

In 1998 the two surprised the country by forging an “opposition agreement” making Zeman prime minister and Klaus leader of a cooperative opposition.

Political analysts see this as a dark period leading to a rise in corruption in public tenders and privatizations. The constitutional court blocked the parties’ attempt to change election rules to their benefit.

Zeman, however, maintained course to join NATO in 1999, and also kept the country on track to enter the European Union in 2004.

Zeman and Klaus - who served two presidential terms before Zeman - grew closer over the years, both sniping against liberal elites and adopting a favorable attitude to Russia. Klaus backed Zeman in his 2013 victory and this year’s election.

RUSSIA

When elected president in 2013, Zeman raised an EU flag above the Prague Castle. But he has focused on building ties with China and Russia. He attended military parades in Moscow and Beijing that other western leaders shunned, and appointed a Chinese company leader as his adviser.

Contrary to official Czech government policy, he repeatedly called for the end of EU sanctions on Moscow over the annexation of Crimea.

He also come under criticism for the men around him. His main adviser, Martin Nejedly, lived in Russia for a decade but little is known of his business there. He co-owned a Czech subsidiary of Russian oil firm Lukoil and does not have security clearance.

Zeman has also tested the constitution’s boundaries in appointing governments.

Political analyst Tomas Lebeda said Zeman would now be even less concerned about appearances.

“He will not control or restrain himself, as he promised several times between the first and second round - on the contrary,” Lebeda said.