A farmer who masterminded a $142 million organic-food scam — and spent his ill-gotten gains on escorts and gambling in Las Vegas — killed himself after being sentenced to 10-plus years in prison.

Randy Constant, 61, was found dead in a vehicle inside the garage at his home in Chillicothe, Mo., on Monday evening, according to the Associated Press.

Livingston County Coroner Scott Lindley determined that Constant died of carbon monoxide poisoning and ruled it a suicide, the AP said.

Constant pleaded guilty in December to wire fraud in a case that federal prosecutors in Iowa dubbed “Field of Schemes” and described as the largest organic-food con in US history.

He was sentenced on Friday to 122 months behind bars but allowed to remain free bond while the US Bureau of Prisons decided where he would serve his time.

Between 2010 and 2017, Constant sold more than 11.5 million bushels of grain more than 90 percent of which he falsely claimed was grown on certified organic fields in Nebraska and Missouri.

During 2016, his crooked sales equaled about 7 percent of all organic corn and about 8 percent of all organic soybeans grown in the US, prosecutors said.

The grain was mainly used as feed for cattle and chickens to produce premium-priced meat and eggs that were marketed as organic, with federal Judge C.J. Williams saying Constant did “extreme and incalculable damage” by ripping off consumers and damaging faith in the organic-food industry.

While pulling off his scam, Constant traveled more than 20 times to Las Vegas, where he stayed in hotels, hired escorts and gambled, prosecutors said.

He had sexual relationships with three women who lived in Sin City, paying two of them more than $225,000, purportedly for their work for his companies, even though they did “very little of value” for the money, prosecutors said.

Banking records show Constant also spent more than $360,000 in Las Vegas, including about $110,000 from a bank account he shared with one of the women.

That spending included payments for breast augmentation surgery, foreign travel and a vehicle and insurance, prosecutors said.

At Constant’s sentencing, his lawyer, Mark Weinhardt, called him a “real puzzle,” noting the contradiction between his long-running fraud and good deeds that included serving on the school board and donating time and money to local causes and the Methodist church, the AP said.

Following his suicide, Constant’s wife, Pam Constant, released a statement that said, “I know Randy was deeply ashamed of his conduct. As much as we tried to be there for him … it was clearly just too much for Randy.”

She also said he’d be remembered as “a wonderful father, community leader, tireless volunteer and my beloved husband of 39 years.”