ISTANBUL — Turkey began releasing tens of thousands of prisoners last week to stop a spiraling coronavirus outbreak from racing through its overstuffed jails. But Selma Altan, who is 71 and especially vulnerable because of a respiratory condition, was among a group of prisoners left behind, charged with what human rights groups say are political crimes.

A justice reform law passed by parliament last week that would temporarily or permanently release tens of thousands of prisoners excluded inmates serving time for more serious crimes and people like Altan, a prisoners’ rights advocate who was accused of terrorism. Turkish prosecutors have used terrorism charges to lock up the state’s most dangerous adversaries but also journalists, opposition politicians and civil society activists, lawyers and rights groups say.

Altan worked for a group that provided legal assistance and other aid to Turkish prisoners, according to Altan’s daughter, Su Esmen. She said her mother suffers from chronic obstructive pulmonary disease, a condition that hinders airflow in the lungs and could put her in grave danger if she were infected with the coronavirus.

Other inmates are at risk as well, held in pretrial detention or sentenced “without evidence that they committed violent acts, incited violence, or provided logistical help to outlawed armed groups,” Emma Sinclair-Webb, Turkey director for Human Rights Watch, wrote last month in a briefing on the prisoner releases.

These inmates include Osman Kavala, 63, a philanthropist accused of fomenting protests, and Ahmet Altan, a 70-year-old novelist sentenced to more than 10 years in prison on charges of aiding a terrorist organization. Selahattin Demirtas, an imprisoned human rights lawyer and the former co-chair of Turkey’s second-largest opposition party, suffers from a heart condition.

Turkey is struggling to contain one of the worst covid-19 outbreaks in the world. More than 90,000 people have been infected, more than the number of cases officially announced by China or Iran, two early epicenters of the pandemic.

The virus has spread to the prison population as well, infecting more than 80 prisoners and killing three, according Turkey’s justice minister and prosecutors in Izmir, on the Aegean coast. Seventy-nine prison employees have also tested positive.

President Recep Tayyip Erdogan, speaking after the parliamentary vote to release prisoners, said “all measures have been taken to protect prisoners and convicts in prisons from the threat of the epidemic. Every precaution is being taken to prevent these people, whose rights, lives and health are entrusted to the state, not to get infected.”

He and other officials have denied Turkey holds prisoners for political reasons and said journalists and others are prosecuted only for violations of the law.

Around the region, governments have released inmates to prevent a stampede of infections in the close confines and often filthy conditions found in the prisons of the Middle East. Iran released or furloughed more than 85,000 prisoners last month, including some political prisoners. Bahrain, a tiny island state in the Persian Gulf, has released hundreds of prisoners but, like Turkey, kept its most prominent dissidents behind bars.

One of the most prominent holdouts is Egypt, which has released only a handful of prisoners and tightened restrictions for the rest, suspending family and legal visits. Last week, Alaa Abd El Fattah, a software developer and one of the country’s best known political activists, began a hunger strike to protest the worsening conditions, his family said in a statement.

Turkey’s prisons began to swell in the aftermath of a failed coup in 2016, when the authorities detained thousands of followers of Fethullah Gulen, a U.S.-based Turkish Muslim cleric accused of masterminding the coup attempt, as well as members of a banned Kurdish group.

The dragnet also swept up others who were considered dissenters or otherwise disloyal, including some of Turkey’s most prominent writers, politicians and dozens of journalists. At least 101 journalists remain imprisoned, according to Expression Interrupted, a free speech organization.

Human rights groups have praised the releases of nearly a third of the approximately 300,000 inmates in Turkey’s jails, but argued more prisoners should be freed quickly. In an open letter to the government last week, a group of free speech organizations called on the authorities “to move now to prevent a humanitarian disaster.”

Selma Altan started working with prisoners about six years ago, a vocation she found while nearing retirement after a lifetime of sundry jobs as a photographer, an accountant and a clothing designer, her daughter said. She worked as a manager at an organization, Tuhay-dar, based in the city of Izmir.

She was detained in November at her daughter’s house in Istanbul. Ten to 15 officers, including special forces troops, arrived at 6 a.m. to arrest Altan, who has trouble standing for long periods and is badly in need of a knee-replacement operation.

“They didn’t seem to realize how old she is,” Esmen said.

The charges — membership in a terrorist group — were unfounded, her daughter said, and appeared based on the testimony of witnesses whose identities have not been revealed by prosecutors. The courts also seemed to indicate that Altan and her confederates were not much of a threat: Other members of her organization who were arrested at the same time have since been released from custody as their trials continue.

Altan is being held at a women’s prison near Izmir, her detention prolonged because courts in Izmir and Istanbul argued about who had jurisdiction over the case. It had become harder to check in on her after prison visits were suspended because of the pandemic, her daughter said. And it was unclear when her case would be resolved. Her lawyers had trouble reaching anyone at the court these days, as staffing hours were cut back.

“We are worried, because we don’t know when she is going to have her trial,” Esmen said.