This was a zero-sum political choice, and Mr. Van der Bellen’s decisive victory — by 6.6 percentage points with 99 percent of votes counted — left his supporters predictably jubilant, if surprised.  In recent days, they had seemed resigned to fearing that Mr. Trump’s victory, in particular, was tilting the outcome here against them.  “It is unbelievable,” said Wolfgang Petritsch, a veteran diplomat, a biographer of the former Austrian Chancellor Bruno Kreisky and the chairman of Austria’s Marshall Plan foundation. “Austria saves the world!” he said with a twist of irony.  Austria is too small a sample to know whether the populist tide is abating. Europe still faces pivotal elections next year in France and Germany, as well as the possibility of a snap election in Italy. Those races will define politics in the European Union for the remainder of the decade.  But Austria does seem to disprove the idea that Mr. Trump’s victory accelerated a broader public acceptance of populist, anti-establishment forces. In recent days, many in Austria had seemed resigned to the likelihood of a Trump bounce for the far right. Mr. Hofer himself said in an interview last month that the American election had bolstered support for his Freedom Party.  Yet it was not the case.  “People followed Trump with curiosity, shock, fear, jubilation, but I don’t think they drew any conclusions,” Johannes Hübner, a Freedom Party parliamentary deputy, said on Sunday night. “It’s like a Hollywood movie.”  Perhaps the message Austrians received, he said, was “beware of another Trump — don’t vote for Hofer.”  Mr. Van der Bellen, who exudes a calm in public, campaigned as a sort of anti-Trump, reveling in corny, retail politicking.  In an interview in September, he noted that he had been teased for donning traditional Austrian jackets and attending the numerous village fetes and festivals that are the essence of rural life here. Especially, he said, when “it emerges that I like doing this.”  He also suggested then that the intensity of the campaign had led to a broad politicization across Austria, where the voting age is 16. He said Britain’s “tragic” vote to leave the European Union had made people think twice about Austria’s imitating any such move.  Mr. Hofer’s party is more skeptical of Europe, but he had stopped well short of calling for Austria to leave the European Union.  How leaders of European populist movements have reacted to the election of Donald J. Trump.  The country, which straddles the heart of Europe from Italy and Switzerland to Hungary and Slovakia, depends heavily on tourism and exports for its comfortable living standards. A choice to be the first country in postwar Europe to elect a far-right leader for president could have jeopardized that standing.  The vote was widely watched across Europe as a measure of how high fringe parties could climb in mainstream politics, turning what is normally a sleepy contest for a largely ceremonial post into a measure of the populist wave that has advanced on both sides of the Atlantic.  Anti-migrant and anti-Muslim forces have already ridden a populist path to power in Hungary and Poland and have gained strength in France and even Germany.  Mr. Van der Bellen had appealed to Austrians to vote for reason over extremes. Mr. Hofer campaigned on an “Austria First” slogan, and said he wanted to lead a country that was secure “for our children and grandchildren,” playing on fears of the tide of migrants that have entered Europe.  Mr. Hofer’s failure is likely to reverberate around Europe, where the far right has made inroads from Marine Le Pen’s National Front in France to the far-right Alternative for Germany party, both of which have begun eating into support for mainstream conservatives.  Right-wing parties have been achieving electoral success in a growing number of nations.  Establishment politicians are likely to breathe a sigh of relief and interpret the result as a sign that fringe parties still face what many in Europe have long considered a built-in barrier to broader support because of historical associations with fascism.  One person who may thank the Austrians, with whom she has tussled over immigration, is Chancellor Angela Merkel of Germany.  Austria’s rejection of the anti-European wave comes as Ms. Merkel heads this week into a congress of her conservative party, at which she will be anointed its candidate for a fourth term in elections next year.  Ms. Merkel issued no immediate reaction to the Austrian vote, but her vice chancellor, the Social Democratic leader Sigmar Gabriel, called it “a victory for reason.”  Still, Mr. Hofer made the biggest advances of any populist in Europe, racking up almost 50 percent of the vote when he lost a presidential runoff by just 31,000 votes.  Amid a migrant crisis and discontent with the European Union, many far-right parties have achieved electoral success. Here are eight of the most noteworthy.  His party contested the slim defeat, and Austria’s highest court ordered a rerun on procedural grounds. That was then postponed to Sunday, from October, after absentee ballots were found to have faulty glue.  Despite the drawn-out process, voter interest and emotions ran high.  The presidential contest was the hardest-fought since 1986, when Austrians elected Kurt Waldheim, a former United Nations secretary general, despite revelations that he had concealed his service in Hitler’s armed forces close to the sites of Nazi atrocities in the Balkans during World War II.  An array of establishment figures lined up behind Mr. Van der Bellen, but Mr. Hofer garnered some support from mainstream conservatives in the People’s Party, which declined to back the former Green leader.  Mr. Petritsch and other political veterans said the length of the campaign worked in Mr. Van der Bellen’s favor. He was the clear favorite of voters in Vienna and other cities, and apparently was able to reach into rural areas where Mr. Hofer won in May but performed less strongly Sunday.  “He built a broad coalition,” said Alexandra Föderl-Schmid, the editor in chief of the liberal daily Der Standard. Now, she said, Austrians will expect Mr. Van der Bellen to mend the rifts that appeared during the bitter campaign.  After early projections showed him clearly lagging, Mr. Hofer, 45, quickly conceded on Facebook, asking “all Austrians to stick together and to work together.”  “Dear friends,” Mr. Hofer wrote, “you supported me so well and I am infinitely sad that it did not work out.”  A version of this article appears in print on December 5, 2016, on page A7 of the New York edition with the headline: Austria Rejects Far Right in Test of Trump’s Effect. Order Reprints| Today's Paper|Subscribe
Voters chose the former Green Party leader Alexander Van der Bellen, in a result that seemed to show the limits of Donald J. Trump’s populist tailwind.