The releases follow a decree by Lopez Obrador in August 2021 ordering the release from federal jails of people who had been tortured, as well as certain elderly and ill prisoners who have not committed serious crimes and others held without sentencing for over the legal maximum of two years.
The release of a total 2,685 people, which follows a 2019 amnesty law benefiting individuals in prison for minor crimes, comes as Lopez Obrador has drawn criticism from human rights groups for his government's extensive use of pre-trial detentions.
The releases are an "act of justice for those who have not committed serious crimes relating to violence or bloodshed," said Rosa Icela Rodriguez, head of the Security and Citizen Protection law enforcement agency.
She described the released prisoners as "humble people, who were unable to pay for a lawyer, a translator, or who have confronted adversity," and said among them were 23 women, 120 elderly adults, 208 people with chronic or degenerative illnesses, 15 foreigners and 51 indigenous people.
Mexico's prison population had grown 4.4% under Lopez Obrador by 2021 from the year before, reaching 204,360, according to national statistics agency INEGI.
The releases come as the country's Supreme Court has faced recent calls to curtail the government's widespread use of pre-trial detention, which Lopez Obrador has defended and expanded in 2019 to embrace some non-violent crimes, like corruption.
Earlier this month, the United Nations' working group on arbitrary detention said the practice has resulted in "multiple violations" of "fundamental human rights."
The number of people in Mexico held in preventive detention or without a sentence grew 7.6% in 2021 to 92,856, INEGI said.