The air was thick with dust as the jockeys, all of them riding bareback, coaxed their horses to barrel down the dirt track of the Belang Bebanka horse track in Suku Gayo, a rural village in Takengon, Central Aceh.

But the crowd, shivering in the early morning chill and covering their faces, couldn't have cared less. Nothing, not the dust nor the cold was going to keep them away. Some had waited for hours to get the best seats. Others, many of them farmers from villages farther away, camped out at the site for an entire week, packing in as many races as they could before the start of the local growing season.

The horse races are like a national holiday in Suku Gayo, only even better. A lot of the holidays in Indonesia's most-conservative province, Aceh, are religious in nature. They are moments of prayer, reflection, and togetherness. The horse races, on the the other hand, are about something completely different; something banned by the province's Sharia authorities—gambling.

Men crowded around the bookies before the start of each race and held out rupiah notes, shouting their bets out. “I’ve got red,” a middle-aged man standing behind me shouted out as he pulled a Rp 50,000 ($3.28 USD) note from his pocket. "I've got yellow!" a much younger man yelled. "Blue! Blue!" another screamed from behind.

All this illegal betting hasn't gone unnoticed. Gambling is illegal throughout Indonesia, and it's forbidden by Islamic law, which makes it doubly illegal in Aceh—the only province allowed to enforce its own version of Sharia law. Local authorities in Takengon district have called the betting illegal, warning that offenders could be punished by the Sharia Police.

But, for the race's fans, the warnings are doing little to stop the betting.

“It's the whole reason why the horse races are so entertaining,” said Soli, who, at 13 years old, was there to gamble.

Most bets are kept low enough to let everyone get a chance—think Rp 20,000 ($1.31 USD) to Rp 50,000 ($3.28 USD). But a few big shots routinely throw down tens of millions of rupiah at a time. The betting is simple. Win, and you'll earn back double your bet. Lose, and you win nothing. It's an easy-to-understand system that keeps people entertained for a half-dozen races a day.

Watch: The Annual Drunken, Deadly Horse Races of Guatemala

But, the days of betting might be drawing to an end, according to Syahrial Apri, the local police chief. This is the last year his officers will look the other way, he told me. Next year, the races are going to be gambling-free.

“Betting has only just been banned,” he told me. “There are plenty of violations at the race track. We also recently confiscated some alcoholic beverages." (Alcohol is also illegal under Aceh's Sharia Law.)

The truth is, the gambling at the horse races isn't the work of some big organized betting syndicate. It's mainly a way for working class farmers to entertain themselves between growing seasons. Most of the teenagers I met there were just looking for a little fun, and a little extra income to supplement their pay from the coffee plantations. This part of Aceh is home to a world-famous strain of coffee. For most of the kids, their days are simple and routine: wake up, go to school, work the plantations, go to sleep, repeat. The races are a welcome respite from an otherwise repetitive life.

"We don't have that many forms of entertainment around here," one of the teens told me. "Not unless there's a horse race going on."

The races themselves are timed with the growing seasons. Most of them begin at the end of August and run until mid-September, when its time to harvest the beans.

“For us as coffee farmers, this is just a small leisure activity during harvest season,” one of the horse owners told me. He asked to remain anonymous out of fear of being banned from next year's races. “We know that betting has been banned for the past two years, but of course we continue it in secret.”

The 45-year-old horse owner was placing bets that totaled in the millions of rupiah at a time. It was all coffee money. Coffee runs everything in Central Aceh. The industry was worth an estimated $41.3 million USD this year, making the crop responsible for 80 percent of Central Aceh's local economy.

“When I have a lot of money, I can bet a lot," the owner told me. "I’m only betting a little now because my coffee yield this year wasn’t as much. Hopefully with Rp 10 million ($656 USD) I can bring home three times that amount so I can care for my horse."

The jockeys reap the benefits from the gambling craze too. On top of the prize money afforded to the winners, they sometimes receive bonuses from ecstatic winners. Anto, a 35-year-old jockey, told me that he's been in the top three local riders for the past five years and is getting famous amongst the gamblers. And he depends on the good will of these gamblers to make ends meet. Jockeys typically only receive about 20 percent of the total prize money, with the rest going to the horse's owner. But the tips from grateful gamblers can more than double that amount, Anto told me.

“After a race, I usually bring home about Rp 10 million ($656 USD) as a bonus from the betters. If I win, the prize money is Rp 4 million ($262 USD), and that’s a lot,” Anto explained.

But, for the horses owners, the races are more about pride than the money. Cek, another owner, told me that it typically takes about Rp 15 million ($982 USD) a month to keep a champion race horse. The top prize money is a fraction of that, at Rp 6 million (392 USD), so his horses are racing more for respect than cash.