The woman who has been elected Slovakia’s first female president said her victory showed “you can win without attacking your opponents”, after fighting a positive campaign based on progressive values and political reform, and providing a rare moment of hope for liberal politics in central Europe.

Zuzana Čaputová, a 45-year-old lawyer and anti-corruption campaigner, won 58.4% of the votes in Saturday’s poll and will take office in June.

A political outsider who was polling in single figures a few months before the vote, her campaign used the slogan “Stand up to evil”, but she eschewed personal attacks on her opponents and has spoken of the importance of the values of “humanism, solidarity and truth”.

“Let us look for what connects us. Let us promote cooperation above personal interests,” she told a crowd of supporters in Bratislava. “I am happy not just for the result, but mainly that it is possible not to succumb to populism, to tell the truth, to raise interest without aggressive vocabulary.”

Prior to her surprise entry into politics, Čaputová was a civil activist best known for blocking a planned landfill site in her home town in 2016. She also played a role in anti-government protests that broke out after the murder of the investigative journalist Ján Kuciak and his fiancee, Martina Kušnírová.

After topping the first round of voting two weeks ago, she comfortably won the run-off against Maroš Šefčovič, an EU energy commissioner backed by the governing party Smer, an ostensibly centre-left grouping that has increasingly used rightwing populist rhetoric over recent years.

Šefčovič said during the campaign that he wanted to appeal to voters “who insist that Slovakia remain a Christian country”, an attack on Čaputová’s liberal views on LGBT rights and abortion legislation.

However, he was magnanimous in defeat, saying he had called Čaputová to congratulate her and also planned to send flowers. “The first female president of Slovakia deserves a bouquet,” he said.

Across central Europe, liberals have struggled to counter rightwing messaging from governments on migration and social issues. However, Čaputová’s message resonated, especially in Bratislava and other cities, tapping into a frustration with career politicians among a young, well-educated demographic.

Čaputová, the president-elect, arrives for a interview with Czech TV in the front of the presidential palace in Bratislava. Photograph: Joe Klamar/AFP/Getty Images

“It shows that liberals should stay liberal, and not fight propaganda with propaganda. It shows what you can do with a high-quality candidate and a good, positive campaign,” said analyst Balazs Jarabik of the Carnegie Endowment.

However, he cautioned that Čaputová’s victory came on a low turnout of just over 40%, and that European elections in May and parliamentary elections next year may see a very different result.

Previously, discontent with traditional politicians in Slovakia has led to populist and extreme nationalist parties entering parliament. In one region, Banská Bystrica, the neo-fascist Marian Kotleba was elected as a regional governor in 2013, and he garnered 10% of votes in the first round of the presidential race. Another candidate known for his far-right rhetoric, Štefan Harabin, won a further 14% of the vote.

The hope for the region’s liberals is that discontent with the political status quo can be channelled by politicians like Čaputová rather than those of the far right.

“Zuzana Čaputová gives us hope, but the real fight will only come now,” wrote Dennik N, a leading opposition publication, on Sunday.

The presidency has a largely symbolic function in Slovakia, where the prime minister runs the daily business of government, but the president has significant blocking powers, appoints top judges, and is commander-in-chief of the armed forces.

The outgoing president, Andrej Kiska, who has clashed with the government and been regarded as a progressive force in Slovak politics, decided not to run for a second term in office and said he welcomed the election result. “Slovakia is in a moral crisis and needs a president like Zuzana Čaputová,” he told journalists in Bratislava.

Robert Fico, the head of the Smer party and for many years the country’s prime minister, stepped down last year in the wake of massive street protests over the Kuciak murder, but is still regarded as the most powerful politician in the country.

The Kuciak murder shocked Slovakia and threw a spotlight on links between officials and corrupt networks. Police have charged five people, including a millionaire with alleged links to Smer, of ordering the killings. Čaputová has promised to make changes that will strip the police and prosecutors of political influence.