The prime minister of Estonia has been urged to break off coalition talks with far-right nationalists by one of his key allies in the European parliament.

Jüri Ratas, the country’s premier since 2016, is scrambling to create a coalition to keep his Centre party in power following elections earlier this month that gave no party a majority.

Reversing a pledge not to work with the far-right Conservative People’s Party (EKRE), Ratas has embarked on coalition talks with it, triggering a warning from Guy Verhofstadt, the leader of the liberal group in the European parliament.

“I am writing to firmly ask you not to form a coalition with the Conservative People’s Party of Estonia, a far-right party which is reminiscent of fascist regimes in Europe,” Verhofstadt wrote in a letter. The former Belgian prime minister leads the ALDE bloc in the European parliament, which includes Estonia’s Centre party.

“It is my firm belief that such a cooperation would be harmful for the Estonian society and its geopolitical position, and also cause irreparable damage to our excellent cooperation inside the Liberal family,” he added.

EKRE, which campaigns against immigration and wants a referendum on EU membership, more than doubled its share of the vote, gaining 19 of 101 seats in the Estonian parliament.

While it is far from guaranteed that coalition talks will succeed, the arrival of the EKRE in power would heighten concerns about a far-right drift in Europe, following ultra-nationalist gains in Italy and Austria.

The EKRE recently joined like-minded parties in opposing a non-binding UN migration pact, while the party’s leader, Martin Helme, has previously said only white immigrants should be allowed into Estonia. Another party official criticised a court verdict to register a same-sex Swedish couple as spouses in 2017, saying he wanted judges’ “heads to roll”.

The latest twist in coalition talks surprised commentators, who assumed the two largest parties, Reform and Centre, would form a coalition. The leader of the pro-European, centre-right Reform party, Kaja Kallas, was expected to become Estonia’s first female prime minister. But Centre ruled out a coalition, opening the way for Ratas to try other governing constellations.

Any coalition with the far right could create complications with allies in Europe ahead of European elections in May. In an interview with the Guardian, Verhofstadt ruled out an alliance with Italy’s Five Star Movement, because it is in coalition with the far-right League.