BOSTON — With the deadline to vote before the end of Massachusetts’ legislative session looming, both chambers acted to fund community-based residential reentry programs at $5 million in the fiscal year that began July 1.

The funding, which will be administered under a competitive grant program, represents a 4,900 percent increase over the previous year’s funding for reentry, which totaled less than $100,000. The action by the lawmakers followed months of advocacy from a broad coalition that included Community Resources for Justice, law enforcement representatives, prosecutors, defense attorneys, elected officials, and dozens of individuals and community organizations.

Reentry programs help change lives and strengthen communities by reducing recidivism. But lack of funding has forced multiple programs to close or dramatically scale back over the last few years.

The funding will create a competitive grant program that will allow non-profit organizations to obtain funding to provide intensive case management and supports for individuals as they transition back into the community after incarceration. Those supports include assistance finding employment and housing, as well as accessing substance abuse and mental health counseling.

The Senate followed the House by voting Monday — one day before the end of the legislative session — to override Gov. Baker’s veto of half of the funding, securing a commitment to fund the grant program at a level that will provide vital assistance to an estimated 800 individuals.

“These programs have a great impact on individuals as they prepare to re-enter the community,” state Sen. Joan Lovely, D-Salem, said before the Senate vote. “Without safe and stable housing, a job and other supports, the likelihood of re-offending is exponential. These programs help reduce recidivism.”