GADSDEN, Ala. — An Alabama sheriff who was criticized for making money from the county jail's food program has been defeated in a primary election.

In Alabama, it's possible for sheriffs to personally profit from jail meals. In many cases, the less a sheriff spends on feeding inmates, the more he or she can make.

The origins of the law can be traced back to when chain gangs were common in the late 1920s: Alabama passed a law that gave sheriffs $1.75 a day from the state to feed each prisoner, and sheriffs got to pocket anything that was left over.

Before Tuesday's Republican primary election for sheriff, Etowah County Sheriff Todd Entrekin released tax forms showing he made a profit of $672,392 from the jail kitchen in 2015 and 2016. Entrekin had made the documents public during a news conference where he denied allegations that prisoners were malnourished.

More: Sheriffs feed inmates, keep extra cash reported in March that Entrekin pocketed more than $750,000 over the past three years from a source he identified as "food provisions," according to ethics disclosures. 

The publication also reported that Entrekin and his wife purchased an upscale 4-bedroom home for $740,000 in September.

Rainbow City Police Chief Jonathon Horton, who won the primary, tells that Entrekin called him and conceded the race after early returns showed Horton with a large lead.

Contributing: Jay Reeves, Associated Press

FILE-In this Wednesday, Aug. 13, 2014 file photo, Etowah County Sheriff Todd Entrekin speaks to the media about a synthetic drug called AB-Pinaca, in Gadsden, Ala. For decades, Alabama sheriffs have made money by feeding prisoners for only pennies per meal and pocketing reimbursement funds that critics say could go to extra meat, vegetables or apples. Entrekin recently released tax forms showing he made a total profit of $672,392 from the jail kitchen in 2015 and 2016.(AP Photo/Brynn Anderson, File)
Brynn Anderson, AP