Ambassador Martin Erdmann was at the courthouse to attend the hearing of former HDP head Selahattin Demirtas, who is facing terror charges. Turkey has cracked down on the opposition party since the failed coup in 2016.
A Turkish court on Wednesday denied entry to the German ambassador to Ankara to the hearing of Selahattin Demirtas, the former co-leader of the pro-Kurdish Peoples' Democratic Party (HDP).
Ambassador Martin Erdmann wanted to follow the hearing of the Kurdish politician in Ankara's Sincan district, but the court denied him access, the German Embassy in Ankara said on its Turkish language Twitter account.
Demirtas has been in pre-trial detention on terrorism-related charges since November 2016. He faces up to 142 years in jail if found guilty.
Ankara accuses HDP, the second-largest opposition party in the Turkish parliament, of maintaining close ties to the outlawed Kurdistan Workers' Party (PKK), an armed group that has waged a decades-long insurgency against the Turkish state.
But Germany and other European countries have said Ankara was targeting the opposition in the wake of the failed coup, and have red flagged the worsening of freedoms, fundamental rights and the rule of law in Turkey.
Turkey has arrested tens of thousands of soldiers, police officers, judges and teachers for suspected involvement in 2016 coup which President Recep Tayyip Erdogan used to expand his powers.
The HDP elected parliamentarians Pervin Buldan and Sezai Temelli new leaders on Sunday.