It all started at 1 a.m., when officers were called to a TD Bank branch. A transient was inside the bank sleeping beside the ATM. Officers went inside and moved him along.

But, he came back. At 5:30 a.m., a woman waiting to use the ATM called police to report a man spending an unusual amount of time at the machine. When South Portland police officers drove up, they saw the same homeless man inside filling a shopping bag with cash.

How much? More than $37,000.

"This is a first," South Portland Police Lt. Todd Bernard said.

Bernard said police have dealt with the man before. The man used his bank card to withdraw $140 from his account, but then kept going, Bernard said.

And the ATM just kept giving him money.

The police said it gave the money back to the bank and that the bank didn't want to press charges.

As for that ATM, it was out of service later Thursday.

"Due to a code error, this TD Bank ATM dispensed an incorrect amount of cash to a customer," a TD Bank spokesman said.

The spokesman said no customer accounts were affected.

Because no charges were filed, police won't release the homeless man's name. But they aren't ruling out the possibility of cha