ISTANBUL — An Istanbul court on Wednesday ordered the release of Amnesty International’s top representative in Turkey, one of the most prominent political prisoners in the country detained under a widespread crackdown against government critics.

The court ordered the release of the prisoner, Taner Kilic, chairman of Amnesty International Turkey, but the terrorism charges against him have not been dropped. A local court later stopped his release.

Mr. Kilic has been imprisoned for more than six months in Izmir, his hometown. He was accused of links to the outlawed movement of Fethullah Gulen, a cleric living in exile who is accused by the government of terrorism for a coup attempt in 2016.

The ruling was met with shouts of joy by supporters who hugged each other in the Istanbul courtroom, as Mr. Kilic was shown via videolink from Izmir.