Cops secure the scene at an HSBC branch on Grand Avenue just moments after an of-duty cop halted an armed robbery.

A man armed with a fake gun picked the wrong time to rob a Maspeth bank, his attempt thwarted by an off-duty cop doing a little personal banking.

At approximately 11:30 a.m. last Thursday, Robert Jablonowski pulled out a realistic-looking weapon that resembled a .38-caliber handgun and passed a note demanding hundreds and fifties in a bag to a teller at a branch of HSBC at 65-63 Grand Avenue.

The move was spotted by Officer Patrick Plunkett, an off-duty cop assigned to a Lower Manhattan housing unit, who crept up on Jablonowski and put him in a headlock.

Plunkett, who joined the force in 2005, wrestled the gun free from the would-be robber’s hand and put him under arrest. For his trouble, Plunkett had one of his teeth knocked out during the dust-up.

The gun turned out to be harmless, but Plunkett didn’t know that when he bravely confronted the thief.

Jablonowski, 36, of 79th Street in Glendale, had a prior arrest for possession of stolen property. He now faces charges of attempted robbery.

Plunkett was taken to St. John’s Hospital, where he was treated for his injuries and released. (Shane Miller)