SILIVRI, Turkey — A Turkish court on Tuesday acquitted nine people accused of trying to overthrow President Recep Tayyip Erdogan, in a surprising verdict interpreted as an important concession by the government in a trial widely criticized as unjust both at home and abroad.

Among those ordered released was a prominent philanthropist, Osman Kavala, who has spent over two years in detention. But within hours the Istanbul prosecutor announced that he had ordered him kept in custody in connection with an investigation into a coup attempt in 2016.

At day’s end, Mr. Kavala remained in police custody, and he may now face even more serious charges.

Well-wishers who had been waiting for his release near the prison after the verdict eventually began to disperse. According to one news outlet, Mr. Kavala had already been transferred from prison to police headquarters in central Istanbul to be detained on new charges.