Centre-right senator Rodrigo Paz Pereira, 58, won Bolivia’s presidential runoff on Sunday and will be the country’s next president, marking a shift to the right after nearly 20 years of dominance by the leftist Movimiento al Socialismo (Mas) party.

With just over 97% of ballots counted in the electoral court’s “preliminary” tally, Paz Pereira secured 54.6% of the vote, while rightwing former president Jorge “Tuto” Quiroga received 45.4%.

The electoral court stressed that the figures are “preliminary and not definitive”. That is because Bolivia uses two counts: a quicker one, based on photos of each ballot sent to a data-processing centre, and the slower definitive one, in which every vote is publicly counted and scrutinised at polling stations before entering the system.

The court has up to seven days to release the official results.

“Let’s keep building a future, a new path after 20 years that have left us out of the economy … and geopolitics. We must create jobs,” Paz Pereira told supporters at a hotel in La Paz, just over two hours after the results were announced.

He added: “Ideology doesn’t put food on the table. What does is the right to work, strong institutions, legal security, respect for private property, and having certainty about your future – and that’s what we want to work for.”

Bolivia’s next president also mentioned his US counterpart, Donald Trump, saying he hoped “to build a close relationship with one of the most important governments in the world, to be part of the solutions from 8 November [the inauguration date] onwards, and to ensure that Bolivia does not lack hydrocarbons.”

A senator for the department of Tarija, Paz Pereira is the son of former president Jaime Paz Zamora, who governed from 1989 to 1993.

Supporters of Bolivia’s presidential candidate Rodrigo Parereira celebrate after learning the results Photograph: Martin Bernetti/AFP/Getty Images

Despite being an experienced politician – having served as a city councillor, mayor and congressman – he sought to present himself as an outsider and was the big surprise of the first round, winning after starting his campaign near the bottom of the opinion polls.

Election day passed without incident, according to the electoral court and international observers, including those from the European Union.

The defeated candidate, Quiroga – who served as president for 12 months between 2001 and 2002, and was making his fourth attempt to return to power – began his speech at a hotel in La Paz, where his team had gathered, by saying he had called Paz Pereira to congratulate him – prompting cries of “No!” from the crowd.

“Please, I understand the pain we’re feeling. Believe me, if we had systemic evidence [of electoral fraud], we would put it on the table,” said Quiroga, who stated that he would monitor the final vote count but added that he “respected the work” of the electoral court in the first round and “will respect it” in the run-off.

In addition to being Bolivia’s first presidential runoff, Sunday’s election marked the first time since 2005 that no candidate from the Mas party – which first came to power with Evo Morales and later with the current president, Luis Arce – was on the ballot for a presidential election.

Deeply unpopular, Arce chose not to run and instead put forward his interior minister, Eduardo del Castillo, who won just over 3% of the vote in the first round – the minimum needed for the party to avoid losing its legal status.

The collapse of the once-dominant party is attributed to the bitter feud between Morales and his former political protege Arce and to the country’s deep economic crisis – its worst in four decades – marked by soaring inflation and shortages of both dollars and fuel.

Shortly after the polls closed, an image was posted on the vice-minister of communication’s official Facebook page reading: “The Masistas [Mas members] are finally leaving! After 20 years of ruining the country.” The post was deleted a few hours later, and it is still unclear who uploaded it.

The party that once held two-thirds of Congress will, in the next legislature, have only two congressmen and no senators.

The composition of Congress is already seen as one of the main challenges for Paz Pereira as president.

Despite his party, the Partido Demócrata Cristiano (PDC), winning the largest number of seats, with 49 deputies and 16 senators, it will not have a majority to ensure the passage of laws and reforms.

People hug after the preliminary results of Bolivia’s presidential runoff election are announced. Photograph: Claudia Morales/Reuters

Paz Pereira spent recent years travelling across Bolivia – by his own count, visiting about 220 of the country’s 327 municipalities – and won particularly in regions that, until recently, were Mas’ strongholds.

In a country where economists estimate that 80% of the workforce is made up of self-employed and informal workers, Paz Pereira campaigned on a platform of “popular capitalism”, promising low-interest loans for small entrepreneurs.

He also promised to cancel citizens’ debts to the state to boost the economy and said that “there will be no more smuggling because everything will be legal” in Bolivia, pledging to lower import tariffs on goods such as technology and vehicles.

But many analysts believe a decisive factor in Paz Pereira’s success was the popularity of his running mate, former police captain Edman Lara Montaño, 39.

Known as Capt Lara, he rose to fame for exposing alleged corruption cases within the police force in videos that went viral on TikTok – which ultimately led to his expulsion from the force.

Running for the first time on a banner of “anti-corruption”, Capt Lara as times appeared like an independent candidate, and has already said he would have no problem turning against the next president if he saw wrongdoing, saying “I’m the guarantee – if Rodrigo Paz doesn’t deliver, I’ll confront him.”

After the results were announced, Lara said: “We must rebuild the country’s economy; we must guarantee the supply of diesel and petrol. People are suffering; we need to stabilise the prices of basic goods and put an end to corruption.”

In addition to the deep economic crisis, another “legacy” of Arce that Paz Pereira will have to deal with is the arrest warrant against Morales, who for the past year has been in central Bolivia, where hundreds of coca farmers are preventing his arrest for allegedly fathering a child with a 15-year-old while he was president.

During the campaign, Paz Pereira said that if elected, the law would be applied to Evo Morales “as to any other citizen.”