The populist ex-communist Zeman took 51.36 per cent of the vote against 48.63 per cent for Drahos, Czech Television reported quoting full official results.
Political analyst Jiri Pehe told AFP the outcome reflected the "very deep polarisation" of Czech society which is "split down the middle" along rural-urban and populist- liberal lines, echoing divisions elsewhere in Europe and in the US.
A former leftist prime minister, the 73-year-old Zeman represents poorer and rural voters with a lower level of education, while academic and political novice Drahos, 68, appeals to wealthier, well-educated urbanites.
Zeman's victory comes amid a political crisis as billionaire populist Prime Minister Andrej Babis -- dubbed the "Czech Trump" -- is fighting police charges of EU subsidy fraud that are hampering his ability to form a government.
More From This Section
Speaking to a jubilant crowd at his Prague campaign headquarters, Zeman vowed to give political ally Babis plenty of time to cobble together a government.
He also struck an overtly populist tone by insisting that the "intelligence of journalists...(and) some politicians is significantly lower than that of normal citizens."
Congratulating Zeman on his narrow win, Drahos told backers in Prague that "we haven't won, but we haven't lost either," pledging he would not retreat from public life.
In the wake of the 2015 migrant crisis in Europe, the anti-Muslim Zeman staunchly opposed EU quotas designed to distribute asylum seekers across the bloc.
Zeman's stance on the European Union echoes other populist politicians in Poland and Hungary who are at odds with Brussels over the refugee quotas and various rules which they see as attempts to limit national sovereignty.
He once called the 2015 migrant crisis "an organised invasion" of Europe, claiming Muslims were "impossible to integrate".
Billboards across the Czech Republic sought to appeal to voters with anti-migrant messages: "Stop immigrants and Drahos. This is our country. Vote Zeman!"
The pro-European Drahos had also opposed the EU quota system but had insisted the Czech Republic was strong enough to accept its allotted 2,600 refugees.
Drahos underscored his concerns about possible Russian meddling in the campaign, saying that "for (Russian President) Vladimir Putin's regime, NATO is the biggest enemy and we are part of NATO."
Petr Vasicek, a Prague artist, told AFP that he chose the "educated and intelligent" Drahos over Zeman who is "pro- Russian and pro-Chinese, which I don't like at all."
Voter Daniel Hajek said he had chosen Zeman "because he's opening the door to economic cooperation with countries like Russia and China.
"It's important for us, for jobs; our country is at the heart of Europe but we can't go in just one direction," he said in Prague.
Europe's fifth biggest carmaker is dependent on auto exports, mainly to the eurozone, and its economy is expected to expand by 3.4 percent this year.