Police say a 33-year-old man is dead after trying to rob a Rising Sun Avenue takeout shop where an off-duty cop was the only customer.

The officer, who was not named by police, is a detective, was in plainclothes inside Rising Sun Pizza on the 6900 block of Rising Sun at 11:30 p.m. Thursday when two men, one armed, intent on robbing the joint walked in. 

One of the men put a gun to the detective's head, stole $20 and ordered the officer to the floor. When the robbers turned their attention to the cash register and two employees in the store, the detective pulled his weapon and announced that he was a cop, police said.

The man armed with the gun fired at the officer. His gun turned out to be a six-shot blank gun, meaning that the cartridges were loaded with gunpowder capable of making loud gunshot sound. The cartridges however, did not have bullets in them. Surveillance video shows a muzzle flash coming from the blank gun. 

The officer returned fire.

Both men fled the scene, dropping the gun in the shop. The gunman was found dead with multiple gunshot wounds on nearby Tyson Avenue.

Police checked area hospitals for the second suspect. He was not found. 

The detective was placed on administrative duty pending the outcome of an internal affairs investigation, which is standard procedure for officer-involved shooting.