A bank customer who spotted a man with a concealed weapon inside a TD Bank branch in Glastonbury, Connecticut, thought he was doing the right thing by bringing the bank staff's attention to a potential robbery in progress.

Instead, Robert Gursky ended up being arrested for breach of peace after he was mistaken for a robber himself.

Gursky, 50, was inside the bank on Monday when he noticed a man who had a gun tucked underneath his shirt.

Sensing imminent danger, Gursky approached the teller and said the word "gun."

Feeling his warning was not getting through, Gursky began writing a note to explain the situation.

However, before his message was properly conveyed, one of the tellers triggered the panic alarm — on him.

Police arrived on the scene and determined that the suspicious man was a law enforcement official who was permitted to carry a concealed weapon.

Officers then tracked down Gursky, who blamed the whole thing on "miscommunication."

"It could have been a level of confusion, but certainly it was confusing for everyone involved, even the people from the bank," said Agent Kevin Szydlo of the Glastonbury Police Department.

Gursky was arrested and charged but was later released on a promise to appear in court next Wednesday.

[screengrab via WTNH]