An Alabama man that was arrested on drug charges just days after he publicly criticized a local sheriff over the suspicious use of prison funds was released from jail on Friday after signing a plea deal.

Matthew Qualls, 20, pleaded guilty to first-degree marijuana possession, possession of a controlled substance and possession of drug paraphernalia as a part of a plea deal, which dropped a felony drug trafficking charge that he was facing after his February 22 arrest, AL.com reported citing court documents.

Qualls was arrested after police responded to an “anonymous tip” that the smell of marijuana was coming from an apartment where he and a friend were found inside.

The young man, who never has been arrested before, was featured in a report just four days before his arrest, questioning Etowah County Sheriff Todd Entrekin’s use of funds meant to feed county jail inmates.

Etowah County Drug Enforcement responded to the call along with the Rainbow City Police Department.

Qualls was charged by both, despite there being a difference in reports over the weight of the drugs found inside the apartment.

The plea deal, prompted by public outcry over the suspicion behind his arrest, requires Qualls to participate in the Etowah County Drug Court program, where he will be subject to random drug screenings, and must complete substance abuse classes instead of facing prison time, his attorney Sam Bone told AL.com.

Qualls’ original drug trafficking charge carried a mandatory minimum prison sentence.

A February 18 report published by AL.com revealed that some Alabama sheriffs were keeping thousands of dollars of public funds that were meant to feed inmates because of a law that allowed them to keep any surplus not spent on provisions. Some sheriffs’ refusal to show spending records has stirred up controversy.

Qualls, who was paid to mow Entrekin’s lawn in 2015, was quoted in the story asking why he was receiving checks for his services with checks paid for via a “Sheriff Todd Entrekin Food Provision Account,” when he knew of individuals in jail who had gone without meals.

"I saw that in the corner of the checks it said Food Provision, and a couple people I knew came through the jail, and they say they got meat maybe once a month and every other day it was just beans and vegetables," Qualls told AL.com.

Qualls was released from custody on Friday.