Karacsony called his victory "a lesson on democracy" after Fidesz-backed Istvan Tarlos conceded defeat, media reported.
With most ballots counted, Karacsony, 44, had the support of more than 50 per cent of voters in the capital, compared with just over 44 per cent for Tarlos, 71, mayor of Budapest since 2010.
Varhelyi might appear to be an apolitical bureaucrat. But he has loyally defended Orban's policies in Brussels for years. The Orban government has not afforded diplomats and other technocrats any independence and those whose careers have advanced during the past decade have had to display full loyalty to the regime.
For that alone, he should be deprived of any chance to be a member of the new Commission. By limiting the power of the Hungary judiciary in designing a new court system, and by faithfully serving Hungary's illiberal political architecture, Trocsanyi's candidacy is another Orban provocation and an act of confrontation with the Brussels administration.
But since Orban's ruling Fidesz party returned to power in 2010, it has become the must-attend event for right-wing Hungarian intelligentsia loyal to Fidesz.
It was a speech in 2014 that made the biggest waves internationally as Orban set out a vision for an "illiberal state" that became a template for nationalist-populists everywhere.
There's been much talk of late about democracy's imminent demise. China's continued rise, the emergence of strongmen (and would-be strongmen) in democracies like India, Turkey, Brazil and elsewhere, and the growth of illiberal populism in various forms sometimes seems to suggest democracy is on the wane.
This smart, ambitious and energetic group become the face of a generation of activists who were more fearless - and more radical - than any other political circle at the time.
We called ourselves "the children of divorced parents" - a metaphor for the political divisions between rural and urban intellectual circles that we idealistically hoped to heal.