ISTANBUL (Reuters) - Turkish President Tayyip Erdogan on Saturday harshly criticized foreign diplomats in Turkey for attending the trial of two prominent journalists charged with espionage, saying their behavior was not in line with diplomatic protocol.

Turkish President Tayyip Erdogan arrives a meeting with mukhtars at the Presidential Palace in Ankara, Turkey, March 16, 2016. REUTERS/Umit Bektas

The first hearing of Can Dundar, editor-in-chief of Cumhuriyet, and Erdem Gul, 49, head of the newspaper’s Ankara bureau, took place on Friday in a courtroom packed with journalists, academics, and half a dozen foreign diplomats, mainly European, in a case that drew international criticism.

The two journalists are accused of trying to topple the government with publication last May of a video purporting to show Turkey’s state intelligence agency helping to ferry weapons into Syria by truck in 2014.

“The consul-generals in Istanbul attended the trial. Who are you? What business do you have there? Diplomacy has a certain propriety and manners. This is not your country. This is Turkey,” he told a meeting of businessmen in Istanbul.

“You can move inside the Consulate building and within the boundaries of the Consulate. But elsewhere is subject to permission,” he said.

Turkey’s pro-government papers portrayed the attendance of foreign diplomats as an ‘invasion’ of the courtroom. “Crusader unity in trucks betrayal,” the Star daily said on its front page while Turkiye newspaper described it as ‘siege of consuls’.

Erdogan, who has cast Cumhuriyet’s coverage as part of an attempt to undermine Turkey’s global standing, has vowed Dundar will “pay a heavy price”. The two journalists could face life in prison if convicted.

On Friday, the court accepted the prosecutor’s request for Erdogan to be one of the complainants and ruled the trial should be heard behind closed doors, decisions that drew anger from journalists’ supporters.

The trial comes as Turkey deflects criticism from the European Union and rights groups that say it is bridling a once-vibrant press. EU enlargement chief Johannes Hahn described the trial on his Twitter account as a “test case for press freedom and rule of law in Turkey”.

Dundar and Gul spent 92 days in jail, almost half of it in solitary confinement, before the constitutional court ruled last month that their pre-trial detention was unfounded since the charges stemmed from their journalist work.