U.S. Ambassador to Turkey John Bass is criticizing the arrest of a local U.S. Consulate employee in Istanbul, saying it was motivated by “revenge rather than justice” on the part of elements within the Turkish government.

Bass made his comments Friday in the case of Metin Topuz, who was taken into custody Wednesday on terrorism charges.

“There is a big difference between pursuing justice and pursuing vengeance in terms of the rule of law and the democratic norms that this country, and my country, have committed themselves to, both through the Helsinki Charter and their own constitutions,” Bass said at a meeting of Turkish reporters.

Turkey’s semi-official Anadolu news agency, citing security sources, reports that Topuz was in regular communication with alleged leading members of a terrorist network blamed for last year’s failed coup against President Recep Tayyip Erdogan.

According to the government, the Fethullah Terrorist Organization, created by U.S.-based Turkish cleric Fethullah Gulen, was involved in the attempted coup in which more than 250 people were killed. Gulen, who is in self-imposed exile in Pennsylvania, denies any involvement.

Takes issue with media

The same media report says Topuz also faces charges of espionage and attempting to overthrow the constitutional order.

Ambassador Bass took aim at the use of the media in Topuz’s detention.

“I am deeply disturbed that some people in the Turkish government prefer to try this case through media outlets rather than properly pursuing the case in a court of law before a judge. That does not strike me as pursuing justice; it seems to me more a pursuit of vengeance,” he said.

The U.S. ambassador, who is due to leave his post in Ankara for a new assignment in Afghanistan, also pushed back against the Turkish Foreign Ministry, saying Topuz was a staff member.

On Tuesday, the ministry issued a statement saying, “He [Topuz] is neither a staffer of the U.S. Consulate nor does he have any diplomatic or consular immunity.”

Turkish Deputy Prime Minister Bekir Bozdag on Friday, in appearing to contradict the Foreign Ministry, criticized the U.S. diplomatic representation for its employment of Topuz.

“The important thing to be highlighted here is the presence and employment of a terror-linked person at the U.S. embassy without the knowledge of Turkish authorities,” Bozdag said.

U.S.-Turkish tensions have been on the rise over Washington’s support of the Syrian Kurdish militia YPG in its fight against Islamic State. Ankara deems the YPG as terrorists.

“This crisis of the confidence has been there for quite a while,” noted Semih Idiz, a political columnist with Al Monitor website.

But those tensions continue to be exacerbated over the ongoing fallout concerning last year’s coup attempt.

In the days after the botched military takeover, several Turkish ministers and the pro-government media accused Washington of being involved, a charge the U.S. strongly denied; however, the U.S. refusal to extradite cleric Gulen continues to fuel suspicions of Washington’s alleged collusion with him.

Political rhetoric

Turkish President Erdogan is increasingly using in his rhetoric accusations of foreign conspiracies against his government and country.

“It’s affecting the public opinion because when these conspirators are regularly referred to, the Turkish public is simply looking to its [Turkey’s] Western allies as conspirators and as enemies,” said former Turkish Ambassador Unal Cevikoz, who now heads the Ankara Policy Forum.

“If this belief and this perception become more and more structural, then I am afraid it will carry Turkey away from its Western location and it will be very difficult to find a remedy to that illness in the future because it will be a part of the structural Turkish public opinion thinking.”

Erdogan warned recently of what he said was the danger of Turkish students studying overseas and returning as spies. The fear of foreign spies, especially from Turkey’s Western allies, is part of the national psyche. “Under every stone can be found an English spy,” is a Turkish adage.

Analysts point out Erdogan will be aware that stirring xenophobic fears and standing up to Washington will play well with nationalist voters, a key constituent for him in the 2019 presidential elections.