BUCHAREST, Romania — A top Romanian court on Thursday asked the official electoral authority to recount and verify all of the ballots cast in the first round of the presidential election, won by a far-right outsider candidate, sending shock waves through the political establishment.

The Constitutional Court in Bucharest approved the recounting of the more than 9.4 million ballots, and said its decision was final.

Later, the Central Election Bureau approved the court’s request and said that scanned reports were due to be sent in by 10 p.m. Sunday and the original ballots by Tuesday for the recount.

Calin Georgescu, a little-known, far-right populist and independent candidate, won the first round, beating the incumbent prime minister. Georgescu was due to face reformist Elena Lasconi, the leader of the Save Romania Union party, in a Dec. 8. runoff.

Georgescu’s unexpected success has prompted nightly protests by people concerned with previous remarks he made in praising Romanian fascist and nationalist leaders and Russian President Vladimir Putin, and believe he poses a threat to democracy.

Without naming Georgescu, Romanian President Klaus Iohannis’ office said following a Supreme Council of National Defense meeting in Bucharest on Thursday that an analysis of documents revealed that “a presidential candidate benefited from massive exposure due to preferential treatment granted by the TikTok platform.”

Earlier this week, Romania’s National Audiovisual Council asked the European Commission to investigate TikTok’s role in the Nov. 24 vote. Pavel Popescu, the vice president of Romania’s media regulator Ancom, said he would request TikTok’s suspension in Romania if investigations find evidence of “manipulation of the electoral process.”

TikTok did not immediately respond to a request from The Associated Press.

The vote recount was prompted by a complaint made by Cristian Terhes, a former presidential candidate of the Romanian National Conservative Party who garnered 1% of the vote. Terhes alleged that Lasconi’s party had urged people to vote before some diaspora polls had closed Sunday, saying it violated electoral laws against campaign activities on polling day.

After Thursday’s court ruling, Terhes’ press office posted on Facebook that the court ordered the recount “due to indications of fraud,” and alleged that valid votes cast for Ludovic Orban — who had dropped out of the race but remained on the ballot — had been reassigned to Lasconi.

It is the first time in Romania’s 35-year post- communist history that the country’s most powerful party, the Social Democratic Party, did not have a candidate in the second round of a presidential race. Prime Minister Marcel Ciolacu resigned as party leader after he narrowly lost to Lasconi by just 2,740 votes.

Lasconi criticized the court’s decision. “Extremism is fought by voting, not backstage games,” she said, adding that what the court “is trying to do now is absolutely horrific for a democratic country.”

The court on Thursday also rejected a request by another unsuccessful first-round candidate, Sebastian Popescu, to annul the ballot.

Popescu alleged Georgescu — who declared zero campaign spending — had not disclosed financing linked to a massive TikTok campaign, which many have credited for his success.

Popescu, who got 0.15% in the first round, also alleged in his appeal that Georgescu had used widespread disinformation and “defrauded the electoral law by illegally financing the entire electoral campaign, having support from outside the country’s borders, from state entities with the aim of destabilizing Romania.”

Georgescu’s account on the Chinese platform TikTok, which has amassed 5.1 million likes and 450,000 followers, had gained huge traction in recent weeks. Expert Forum, a Bucharest- based think tank, said in a report that the rapid rise “appears sudden and artificial, similar to his polling results.”