A malfunctioning ATM erroneously spat out $37,000 for a homeless man who was picked up by police before he could make off with his haul.
The man was sleeping by the ATM in a TD Bank branch in South Portland, Maine in the early hours of Thursday morning when police moved him on, reports WGME-TV.
However, he returned to the scene and at around 05:30 a woman waiting to use the machine called police to report that he was spending a long time at it.
South Portland police say that the man withdrew $140 from his account but then used the "cash advance" feature to ask for another $700. He did this 53 times, with the ATM obliging every request.
Police arrived to find him stuffing the cash into a shopping bag. The money was returned to the bank, which chose not to press charges and blamed the incident on a "code error".