ZURICH/ISTANBUL (Reuters) - A Turkish court on Monday agreed to release an Austrian student, activist and journalist who was arrested three months ago, but he will have to remain in the country to await judicial proceedings, his lawyer said on Monday.

Two others, both Turkish citizens, were also released in the same case.

Max Zirngast, a political science student who writes for the far-left online publication Re:volt, had been taken into custody in September, prompting Austrian Chancellor Sebastian Kurz to demand an explanation from Ankara for why he had been detained.

Lawyer Murat Yilmaz told Reuters on Monday that Zirngast is accused of being a member of a leftist terrorist organization, as a result of a number of articles he wrote about Turkey and for demonstrations he took part in while in Turkey.

Yilmaz said the court had accepted the indictment against Zirngast on Monday but decided to release him.

“Normally, he would not be released before the first trial but today the court set the trial date for April 11 and released him,” Yilmaz said, calling the charges without merit.

The court has barred Zirngast from leaving the country, the lawyer said.

Ties between Turkey and some European Union countries including Austria have been strained by a wave of arrests made as part of a security crackdown by President Tayyip Erdogan following a failed military coup in July 2016.

Turkey has detained around 160,000 people, including many journalists, and dismissed nearly the same number of civil servants since the putsch attempt, the U.N. human rights office said in March. Of that number, more than 50,000 have been formally charged and kept in jail during their trials.

Two Turkish citizens who were arrested and jailed in the same case and like Zirngast are accused of being members of a terrorist organization were released as well, Yilmaz said. He also said charges against Mithatcan Turetken and Hatice Goz were without basis.