After a local newspaper reported that Sheriff Todd Entrekin received more than $750,000 from a fund allocated to feed inmates in a jail he oversaw, the law enforcement official was defiant, employing a line of defence that has been increasingly trotted out of late by embattled politicians around the country.

Entrekin, the sheriff of Etowah County and a Republican, played the victim, assailing the "liberal media" and lambasting the "miscellaneous fake news stories" that he said had made his family into targets. But he did not deny that he had received money from the fund, according to AL.com, a practice which is legal in Alabama by the terms of an antiquated law.

On Tuesday, Entrekin was effectively voted out of office after losing in the primary by a margin of nearly two to one. The winning challenger, Jonathan Horton, who had pledged during his campaign not to keep any of the feeding funds, "rode a wave of anti-Entrekin sentiment," after the story made national news and followed Entrekin throughout the campaign, AL.com reported.

"His supporters got out and they've done a good job and I congratulate them on the race that they've run," Entrekin said in a video posted by WBRC, a Fox affiliate in Birmingham.

The reports about Entrekin's use of the food funds made national headlines. In March, reporter Connor Sheets wrote that Entrekin and his wife in 2017 had purchased a four-bedroom house with a pool in an upscale neighbourhood in Orange Beach, a Gulf Coast beach town. It was one of multiple properties worth more than $1.7 million that the couple owned together in the state.

Entrekin's salary is about $93,000 a year, according to the newspaper, but Entrekin had filed disclosure forms that revealed that he had "received more than $750,000 worth of additional 'compensation' from a source he identified as 'Food Provisions,' " AL.com reported.

Sheets's first story about the use of the funds came in February. It told the story of Matt Qualls, a 20-year-old who was paid $10 an hour by Entrekin for lawn-mowing services in 2015. Qualls was paid with checks marked with the words "Sheriff Todd Entrekin Food Provision Account," AL.com reported.

"I saw that in the corner of the checks it said Food Provision, and a couple [of] 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. "I put two and two together and realised that money could have gone towards some meat or something."

Entrekin, who was named in the report along with another Alabama sheriff who AL.com reported had been paid $110,000 from meal-money budgets, defended it as lawful and said that he had advocated in the past for the county commission to allocate the funds.

"The law says it's a personal account and that's the way I've always done it and that's the way the law reads and that's the way I do business," he told AL.com "That's the way the law's written."

After the news reports brought the issue to prominence, he held a news conference, defending the quality of the meals he provided inmates and even bringing a sample breakfast to show reporters.

"This is not a bed-and-breakfast," he said, according to News Channel 10. "Dominoes does not deliver here. We don't run to McDonald's and get these prisoners and detainees Big Macs. We do not serve cake on their birthday. But we do provide a healthy meal, that is prepared on site here, and served three times a day."

He also denied that the money had been used to buy the beach house.

"This is probably the most offensive myth that's been spread throughout this whole ordeal," he said. "This discounts the career achievements of my wife. Her name is on the property as well. She is very successful, as you can see by her tax returns. She makes more money than I do."

Entrekin has been the sheriff of Etowah County since 2007.

The peculiar Alabama law dates to an era "when county jails were more of a mom and pop operation and feeding inmates was often the responsibility of a sheriff's wife," NPR reported. If sheriffs are able to feed inmates on less than they receive from the state, "they can 'keep and retain' whatever is left over," NPR said.

The law has prompted a lawsuit against 49 sheriffs from two watchdog groups in Alabama who claim the offices have not complied with public-records requests pertaining to the food program budgets. The curious legal provision has been the subject of controversy before; in 2009, a federal judge ordered Greg Bartlett, the sheriff of Morgan County at the time, jailed until he fed prisoners more, finding that many inmates under his care "had lost significant weight."

"As Mr. Bartlett's wallet got fatter, according to testimony, the prisoners got thinner and thinner," the New York Times wrote about the case in 2009. The judge told the Times that Alabama's law amounted in practice to "an invitation to criminality," noting the financial incentive to underfeed inmates.

Bartlett, who had personally profited "to the tune of $212,000," earned the nickname "Sheriff Corndog" after an allegation that he fed inmates corn dogs twice a day for weeks after purchasing a $1,000 truck of corn dogs with another sheriff, NPR reported.

Entrekin did not return a request for comment.