“For all the talk of Russian meddling — and I believe they have meddled beyond a shadow of a doubt,” he added, “Europe is dividing itself, and they do not have to do much.”
Outside observers cited as an example of Russian interference a pernicious social media campaign against Mr. Drahos that accused him, with no evidence, of being a collaborator of the secret police during Communist rule.
But Mr. Koran noted that Mr. Zeman’s success was most likely fueled by deep divisions in Czech society and the president’s ability to tap into the anxiety of many Czechs who live outside prosperous cities.
Mr. Zeman, speaking to supporters at a hotel on the outskirts of Prague, said this would be his last campaign, vowing to abide by the constitutional term limits. He acknowledged how tight the race was, describing how his advisers had huddled nervously waiting for the numbers from Prague.
In the end, he was propelled to victory by a high turnout in the countryside. Over all, turnout was more than 66 percent.
“Five years ago, 2.7 million voters gave me their trust,” he said. “This time, it was 2.8 million.”
Mr. Zeman’s victory will most likely be viewed with concern by the country’s traditional allies like France and Germany, as well as leaders who are looking for greater integration among the European Union’s member nations.
“They will continue to have to deal with an unpredictable, grumpy populist; with an oligarch prime minister; and the support of the communists” in the Czech Republic, Mr. Koran said.
Eliska Haskova Coolidge, a Zeman supporter and influential public figure, said that many fears of those in the West were overblown. She said she thought that Mr. Zeman’s goal was a healthy relationship with Russia, not a subservient one.
Ms. Coolidge, whose family fled the country after World War II, spent two decades working in Washington before returning home. She said she was no fan of Mr. Zeman’s vulgarity, but was willing to overlook some of his flaws because she admired the depth of his experience.
“It is so important to have a leader who understands politics and who has met with world leaders,” she said.
In the end, Czech voters agreed.
Mr. Drahos conceded the race and congratulated Mr. Zeman. “This is not the end,” Mr. Drahos told supporters gathered in Prague. “We will carry on.”
He then led members of the crowd, some in tears, in a solemn rendition of the national anthem.
Mr. Zeman’s re-election was also a victory for the country’s billionaire prime minister, Andrej Babis, who was appointed by Mr. Zeman and supported his campaign. The president has vowed to stick with him even though Mr. Babis is facing criminal fraud charges. After his victory, Mr. Zeman again promised to give Mr. Babis all the time he needed to form a government.
The election was not only a contest of competing visions for the country’s place in Europe and the world, but also a clash between two candidates with decidedly different styles.
Proudly antediluvian, with an admitted fondness for drinking and smoking, the acerbic Mr. Zeman has been criticized as contributing to the coarseness of the current political climate. His impolitic remarks — like jokes about “liquidating” journalists — have earned him comparisons to President Trump.
Mr. Drahos, the former leader of the Czech Academy of Sciences, has never held political office, and his inexperience was evident in the first of two debates. Looking nervous, he sat on the edge of his seat, while Mr. Zeman reclined and looked as if he were in his own living room, drink in hand.
In the second debate, Mr. Drahos was more confident and more direct in his attacks on the president.
“Mr. Zeman is the past,” he said. “He is now a symbol of division and name-calling.”
For many of Mr. Zeman’s supporters, however, his indecency is his strength, and they say his blunt speech is needed to counteract cowardly political blather.
Mr. Zeman was elected in 2013 in the first direct presidential vote held in the Czech Republic after it broke free from Soviet rule in 1989. Although he has a long history in politics and had served as prime minister, he cast himself as a populist savior working for the common man.
“You are not alone anymore,” was the Zeman slogan plastered on billboards and echoed in meeting after meeting in small towns and villages. His victory then was seen by many as a rebuke of the right-of-center political establishment that had grown smug and out of touch.
But as the migrant crisis in Europe blossomed in 2014, and countries confronted the greatest flood of humanity seeking refuge on the continent since the end of the Second World War, Mr. Zeman was one of the first European politicians to seize on the issue.
He sought to seal off the country and defied efforts by the European Union to force member nations to share the burden equally by taking in migrants through a quota system.
Mr. Zeman said Muslims could never be integrated in Czech society and warned of jihadists who could “blow the Prague castle up in the air,” tapping into an anxiety felt deeply throughout the country and the region. The message would soon be championed by a host of populist leaders, including those in neighboring countries.
But this Czech election campaign was notable for the lack of debate on immigration. The Zeman position was the default position. Still, Mr. Zeman sought to portray Mr. Drahos as a danger to society. “Stop migrants and Drahos,” read an ad in newspapers and on billboards. “This country is ours. Vote for Zeman.”
Mr. Drahos returned fire by attacking a top Zeman adviser, Martin Nejedly, who is known for his close ties to Russia. “Stop Russian Invasion and Nejedly,” the Drahos team wrote in a social media campaign. “This country is not yours. Vote for Drahos.”
The question of whether the Czech Republic will continue to look to China and Russia was a critical issue in the last days of the campaign. While Mr. Zeman has often said he is committed to the European Union and NATO, he said during his victory speech that he would continue to support allowing Czechs to decide their own futures, including a referendum on membership in the bloc.
“I have come to the conclusion that many politicians and journalists have inferior intelligence compared to normal people,” Mr. Zeman said. “And, therefore, I want those normal citizens to have a chance to decide not only in a referendum, but also in direct elections for local government.”
He also said he would try to be less “arrogant,” but he used his speech to go over old grievances, including against Czech journalists who had repeatedly written him off.
“That’s another reason why I consider Czech journalists to be idiots,” he said.