VIENNA—Austrians voted against an anti-immigrant populist as their next president by a resounding margin, bucking a trend of nationalist electoral successes across the West.

Center-left candidate Alexander Van der Bellen beat back a challenge from his right-wing opponent Norbert Hofer, winning 53.3% of the vote in the country’s runoff election, according to a final count of votes cast on Sunday and a projection of mail-in ballot results. Mr. Hofer congratulated Mr. Van der Bellen on his victory in a Facebook post and called...