Updated

An Alabama sheriff who came under scrutiny after he bought an expensive beach house with the $750,000 he pocketed from funds meant to feed inmates was defeated in a primary election on Tuesday.

Etowah County Sheriff Todd Entrekin lost his bid for re-election months after a report from AL.com about his beach house purchase. The sheriff did not deny that he and his wife, Karen, own about $1.7 million in real estate, including the beach home with a built-in-pool worth about $740,000 and a two-story home in Orange Beach worth about $200,900. Entrekin’s annual salary is $93,178.80, AL.com reported.

Entrekin defended the decision to keep the cash and buy the home following the report.

"I don't change laws, I don't make the laws," Entrekin told WBRC in March. "People don't like it. Get on their legislators and change the law. I, as the sheriff, have asked them to change the law, I, as the sheriff, have tried to give it back to the county commission on numerous times. They won't take it. They don't want it."

Todd Entrekin_AP

Sheriff Todd Entrekin lost his bid for re-election following scrutiny after buying a beach house with funds meant to feed inmates. (AP)

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.

ALABAMA REPUBLICAN WHO UN-ENDORSED TRUMP IN 2016 FORCED INTO RUNOFF ELECTION

Some residents questioned Entrekin’s purchase, including Matthew Qualls, who was arrested on drug charges in February just days after he publicly criticized Entrekin for keeping the fund surplus.

Qualls, who had been paid to mow Entrekins’ lawn, told AL.com in an article soon after his arrest he questioned why he was receiving checks for his services 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.

Before Tuesday’s Republican primary election for sheriff, Entrekin released tax forms showing he made a profit of $672,392 from the jail kitchen in 2015 and 2016.

Entrekin was defeated by Rainbow City Police Chief Jonathon Horton, who told AL.com that Entrekin called him and conceded the race after early returns showed Horton with a large lead.

SHERIFF DEFENDS SELF AFTER PUBLIC OUTRAGE OVER $740G BEACH HOUSE, POCKETING MONEY FROM INMATE FOOD FUND 

Entrekin told WBRC he “congratulated” Horton and his supporters for “the race that they’ve run.”

“His supporters got out and they’ve done a good job and I congratulate them on the race that they’ve run,” Entrekin told WBRC.

The Associated Press contributed to this report.