Ursula von der Leyen, the European Commission president, criticised Slovenia’s government for its approach to media freedom and the judiciary, marking a turbulent start to the country’s EU presidency.

In a press event that ushered in Slovenia’s six-month term steering the EU, von der Leyen underlined the need for a free and independent media as “the essence of democracy” and called for prime minister Janez Jansa to unblock funding for a publicly owned press agency.

In a testy exchange, she urged Jansa to name his country’s representatives to the new European Public Prosecutors Office (EPPO) with the “utmost urgency”, and insisted that judges were entitled to their personal political views.

Critics are increasingly concerned about Slovenian democratic norms and the rule of law, amid fears that Jansa may follow a similar path to that of Viktor Orban, the illiberal Hungarian prime minister.

Standing next to von der Leyen, Jansa defended his government’s record and insisted it supported EU principles of respect for human rights — as well as “cultural differences” among its members. “Rule of law is the basic framework of the European civilisation,” he said.

Their tense press conference followed a difficult meeting between Jansa and EU commissioners visiting the country.

In one extraordinary moment, Jansa displayed a photograph of two Slovenian judges pictured with left-of-centre politicians, implying that his country’s judiciary was politically biased, according to people familiar with the meeting.

Frans Timmermans, a commission executive vice-president and member of the Socialists and Democrats political grouping, subsequently declined to appear in a group photo. “I simply could not be on the same podium with PM Jansa” after his attack on the two judges, he said in a statement.

What was supposed to have been a meeting to discuss Slovenia’s agenda for the EU, had turned into an event where the Slovenia prime minister complained about the way his country is being treated, underscoring his strained relations with Brussels.

Von der Leyen did not refer to the photograph at the press conference afterwards, but told reporters that judges were entitled to be members of political parties, adding “this is a fact in every democracy.”

In March, the Slovenian Association of State Prosecutors complained to the Council of Europe, the region’s democracy watchdog, about what it called “numerous inadmissible pressures” on the country’s judiciary. It also noted Slovenia’s delay in appointing two delegates to the European Public Prosecutor’s Office, set-up to pursue misuse of EU funds.

Jansa has often used Twitter to attack media organisations and journalists. In an EU summit last month he also expressed support for Orban during an emotional debate about a Hungarian bill to ban content depicting or promoting LGBTI+ people in schools and the media.

The meeting on Thursday came as the commission gave its approval to the Slovenian recovery and resilience plan, a key step towards the EU offering €1.8bn in grants and €705m in loans under its Next Generation EU plan.

Jansa praised von der Leyen at the press conference for Brussels’ handling of the pandemic and declared his belief in the EU’s founding principles. He said his country could act as an “honest broker” but also it was unrealistic to expect the union to be a melting pot where “we all think alike”.

No one could accuse his country of infringing judicial independence, he said, and defended his country’s handling of the EPPO. While other member states, including Sweden, Ireland, Hungary and Poland, had not even joined the body, Slovenia had no intention of withdrawing.

He also defended his government’s decision to hold back funding for Slovenia’s STA press agency this year, suggesting the money had been held up owing to paperwork issues and a solution could be found.