The German town of Bochum is the 16th largest in the country by population; roughly 350,000 people call it home. In the fall of 2014, though, at least one of them was in a little bit of trouble. A 37-year-old man, whose name wasn’t revealed by the media, had resisted arrest and was facing a fine of €710 (about $900), one he hadn’t paid. As a result, he was now facing jail time. However, he fell through the cracks, and remained a free man for some time afterward.

Then he made the mistake — the lucky mistake — of going to a casino.

For unfortunate reasons, casinos tend to attract people who are down on their luck, and some of them have criminal records. In September of 2014, Bochum-area police were on what the AP called a “routine check” of the casino. There, they came across the above-mentioned unnamed man and discovered that he had an outstanding arrest warrant. Usually when this happens, the scofflaw is arrested on the spot, and this situation seemed to be no different. As Digital Journal reported:

Police informed the man that he had two options. They told him he could pay his fine, which was around $900, or he could be arrested and face 71 days in jail. The man didn’t have enough money on him to pay the fine, but he continued playing the slot machine while the cops were talking to him.

The man should have been taken into custody, brought to the police station, and given the chance to pay the fine. And that’s what would have happened, but the perpetrator in question decided that he as might as well enjoy some last few moments of freedom and gamble away his last Euros. And, for his sake, it’s a good thing he did.

Before the police officers had placed him under arrest, the one-armed bandit grabbed everyone’s attention. Per German publication The Local, “police told the man from Bochum he faced arrest but as they were talking to him the one-armed bandit started to light up. ‘The face of the Bochum man also started beaming all of a sudden,’ police said.” Cash started pouring out of the slot machine. The man had hit the jackpot.

The grand prize was €1,000 — about $1,300 — and more than enough to pay his fine. Moments earlier, having that amount of money seemed impossible, and prison was on the man’s agenda. But due to a stroke of luck, the man was able to pay the fine right there on the spot, avoiding arrest.

Bonus Fact : Slot machines typically involve cartoon-ish images of fruit and, sometimes, a “BAR” icon. (Here’s an example.) If that seems like a weird choice of iconography for a game of chance, the history explains it. Slot machines were first popularized in the late 1800s and, as Wikipedia notes, gambling was (and still is) often looked down upon and criminalized. As a work around, many slot machines paid out in food items and, often, in gum. The fruit pictures corresponded with the types of gum one would win, and “BAR” was the logo of a gum company at the time.

From the Archives : Stripped Down: A one-day casino to save the right to build a more-than-one-day casino.

Take the Quiz : Unscramble the Las Vegas Casinos