"The draft has become law after being accepted," the official Twitter account for the parliament's general assembly said.
Human Rights Watch (HRW) and Amnesty International have criticised the law because detainees charged under controversial anti-terrorism laws are not included.
The rights groups also have condemned the exclusion of other inmates including journalists, politicians and lawyers in pre-trial detention.
This includes people jailed while awaiting a date for their trial to begin, those waiting for a formal indictment or suspects currently being tried.
"Many people who are in prison because they exercised their rights -- they didn't commit any crime -- they're excluded because the government chooses to use its very flexible, and overly broad and vague counter-terrorism laws," Amnesty's Andrew Gardner told AFP.
Among them are businessman and philanthropist Osman Kavala and Kurdish politician Selahattin Demirtas.
Mahsuni Karaman, a lawyer for Demirtas, said he had recently applied for his client's release citing health reasons but there had yet been no decision.Demirtas has high blood pressure and in December, he was taken to hospital after collapsing in his cell.
The ex-leader of the pro-Kurdish Peoples' Democratic Party had complained at the time of chest pains and breathing problems, and received emergency treatment in prison.The new law is "unjust and illegal", Karaman told AFP, adding that a court could rule to release Demirtas without a need for a change in the statute book.
Turkey launched a crackdown after a failed coup in 2016 and Demirtas is one of tens of thousands behind bars because of alleged links to outlawed Kurdish militants, or the movement led by US-based Muslim preacher Fethullah Gulen.
The government accuses Gulen of ordering the attempted putsch but he strongly denies the allegation.
The law affects several types of prisoners, including pregnant women and older people with medical conditions.
But it excludes murderers, sexual offenders and narcotics criminals.
The law passed with a 279-51 majority, Amnesty campaigner in Turkey Milena Buyum tweeted.
She added that after several days of debates in parliament, including some which lasted until the early hours, "not one of the opposition's amendments have been accepted".
When the ruling Justice and Development Party (AKP) presented the bill, it said some 45,000 people would be released under the law that provides early release on parole and the number would rise to 90,000 with those to be put under house arrest.
Justice Minister Abdulhamit Gul on Monday said three prisoners had died from COVID-19 after a total of 17 convicts were infected with the disease.
While 13 prisoners are in hospital and in a good condition, one convict with chronic diseases is in intensive care, Gul said.
Turkey has recorded more than 61,000 infections while nearly 1,300 people have died, according to health ministry figures published on Monday. (AFP) MRJ