In a stunning rebuke of Slovakia’s populist governing party, Zuzana Caputova — a 45-year-old lawyer, activist and political newcomer — was elected Saturday as the nation’s first female president.

Riding a wave of popular discontent over widespread corruption but refusing to engage in personal attacks on her opponents, she vowed to return a sense of decency to Slovakia’s often toxic political climate. Her sweeping victory in a runoff election gave hope to opposition parties across the region that the tide might be turning against the ethnic nationalist and populist movements that have swept to power in recent years.

“Maybe we thought that justice and fairness in politics were signs of weakness,” she told a crowd of supporters around midnight. “Today, we see that they are actually our strengths. We thought that the barrier between conservative and liberal is unbreakable, but we managed to do it.”

The country’s official statistics office said that with 100 percent of the vote counted, she led with 58 percent over 42 percent for Maros Sefcovic, a career diplomat who had the backing of the country’s governing party, SMER-SD.