Erdogan and Alpay have been held 97 and 85 days respectively in a women's prison in Istanbul over their involvement in a pro-Kurdish newspaper, in a case that has caused international alarm.
The court ordered the release of the pair on charges of seeking to disrupt state unity, Asli Erdogan's lawyer Erdal Dogan told AFP outside Bakirkoy women's prison on the outskirts of Istanbul.
But it also ordered they remain in pre-trial detention on separate charges of membership of a banned terror organisation and thus "their arrest continues", he added.
"We will inform her when we visit her tomorrow or the next day."
More From This Section
They were taken into custody in August as part of a probe into the now shut-down pro-Kurdish newspaper Ozgur Gundem on charges of links to the outlawed Kurdistan Workers' Party (PKK).
The Turkish authorities accuse Ozgur Gundem of acting as a mouthpiece for the PKK, which is considered a terrorist organisation by Turkey, the European Union and the United States.
The initial release order prompted reports on Turkish media that they were being set free but state news agency Anadolu also confirmed they were to stay in jail.
Their detention has been criticised by fellow writers and human rights activists including the UN rapporteur on freedom of expression David Kaye.
He met with Alpay during his visit to Turkey last week but was denied access to Erdogan.
"Disappointed that Asli Erdogan and Necmiye Alpay not released from prison. Turkey should release them and many others," Kaye wrote on Twitter.
Erdogan is due to go on trial next month and Turkish prosecutors had demanded life sentences for all nine suspects.