PORTO, Portugal — Rui Moreira seems an unlikely answer to the populist discontent stalking Europe’s mainstream political parties. Scion of one of this city’s richest families, he studied abroad, ran the family shipping business for a while, and then invested in everything from a popular nightclub here to wine distribution in Brazil and real estate in Chile. Until recently, politics was of little interest, he said.

Yet in Portugal’s municipal elections in September, this son of privilege ran as a man of the people, and won. More than that, Mr. Moreira, 57, managed to do something virtually without precedent here or almost anywhere else in Western Europe, being elected mayor of a major city without having been affiliated with an established political party.

His victory, Mr. Moreira said in an interview as he was sworn in last month, amounted to more than a protest vote by citizens fed up with the parties — conservative and Socialist — that have mismanaged Portugal’s economy. It was proof, he said, that “voters now reject a system that has allowed apparatchiks to control traditional parties, in Portugal and elsewhere in Europe.”

Indeed, long-established parties on the left and right are taking a beating across Europe as voters associate them with corruption, joblessness and stultifying bureaucracy — both within parties and governments — feeding a perception that Europe’s crisis is not just one of economics but also of leadership and ideas.