A Turkish court sentenced two journalists to about 10 years in prison for aiding a terrorist group but also ordered them released Monday in view of time served, in one of the most prominent cases of journalists jailed in the crackdown after the 2016 failed coup.

The release of the journalists, Ahmet Altan and Nazli Ilicak, was welcomed by human rights and press freedom groups but was not taken as a sign that President Recep Tayyip Erdogan had eased his aggressive prosecution of political opponents and dissenters.

Tens of thousands of people have been detained in the last three years in cases that the government has linked to the coup attempt and to Fethullah Gulen, a cleric whom Turkey has accused of instigating it.

Mr. Altan and Ms. Ilicak denied the charge that they had aided a terrorist group or had any involvement in the failed coup. Mr. Altan was sentenced to 10 years and six months, and Ms. Ilicak to eight years and nine months; they were released under judicial control, a condition that requires them to report regularly to a local police station.