FARMINGTON — The former treasurer of Farmington’s Care and Share Food Closet was sentenced Thursday morning to serve 30 days in jail and pay restitution for stealing more than $300,000 from the local food pantry over several decades.

Mary O’Donal, 74, pleaded guilty last month to a charge of theft, admitting to having stolen more than $10,000, a Class B crime, and she did not contest the state’s contention that the theft topped $300,000.

Under a recommended sentence that was accepted Thursday morning by a judge in Franklin County Superior Court, O’Donal was sentenced to three years in prison, with all but 30 days suspended, as well as three years of probation and to pay back $291,000 in restitution to the pantry. O’Donal had already deeded her house over to the pantry as part of the restitution arrangement.

Leiza Hiltz Scerbo became the food pantry’s executive director’s job in January 2015 and said she immediately set up teams of volunteers to cover each area of the organization’s work so one person’s illness or lack of availability would not interrupt the pantry’s mission of providing food five days a week to 500 needy families in the Farmington area. The pantry relies heavily on donations and volunteer labor.

Hiltz Scerbo previously said she approached O’Donal wanting to help share the burden that O’Donal had shouldered for decades as the treasurer and sole financial arbiter. But O’Donal was resistant to the oversight, and Hiltz Scerbo and a team of volunteers analyzed Care and Share’s finances, matching checks cashed to invoices.

They found unmatched checks for $1,000 or $2,000 for nearly every month dating back to 2001. However, the pantry’s checking account was in O’Donal’s name and only she could access it. Before she stepped down, O’Donal closed the account.

After three months of scouring records, Hiltz Scerbo turned the documents over to Farmington police, who she said worked with the pantry’s bank to track checks back to the 1970s. They found that for almost every month dating back more than three decades, O’Donal had been writing checks to herself and cashing them, stealing more than $300,000 in total.

“Everybody trusted her,” Hiltz Scerbo said at last month’s plea hearing, adding that the organization’s volunteers were “heartbroken.”

To date, O’Donal has repaid $15,000 of that stolen money. As part of her plea agreement, she also has signed over ownership of her home to Care and Share, though she and her husband will be able to continue living there. In 2016, O’Donal’s home was assessed at $48,250.

This story will be updated.