ABC News' Sydney Lupkin reports:

A Maryland man accused of impersonating a police officer allegedly picked the wrong car to pull over, when he stopped a real cop and tried to give him a speeding ticket.

Anthony Kenneth Mastrogiovanni, 29, of Crofton, was driving a white pickup when he allegedly tried to pull over an off-duty Capitol Heights Police officer Wednesday afternoon, according to Prince George's Country Police, who later arrested and charged him.

When the officer told Mastrogiovanni that he was a cop from a nearby area, Mastrogiovanni said he was a military police officer from Louisiana and informed the off-duty cop that he was speeding, Prince George's County police said.

The officer told Mastrogiovanni that he had no jurisdiction to pull him over and that it was illegal for Mastrogiovanni to have emergency police lights in his truck, police said.

Mastrogiovanni left, but the officer followed until PGPD arrested him on a charge of impersonating a police officer. He was released on personal recognizance, and is awaiting a court appearance.