JOLIET, IL — If you're going to rob a car, make sure police officers aren't sitting in it first.

Derrick J. Smith, 35, of the 1300 block of Pequot, learned that the hard way Tuesday night. Tactical officers with the Joliet Police Department were in the 1300 block of Pequot in an unmarked squad car with heavily tinted windows looking for a wanted person in the area. The headlights of the car were on and the engine was running.

"That's when Smith approached the unmarked squad and started looking into the windows," Joliet Deputy Police Chief Ed Gregory said. "He had gloves on his hands and was peering into the window of the squad." Smith, wearing a hooded sweatshirt, put his hands in his pockets and was then holding something in his hand, Gregory said. Officers in the car, believing Smith was going to try to rob them, exited the squad and told Smith they were Joliet police. That's when Smith took off running.

"While he was running, he kept his hands in his pockets. Smith fell to the ground and took a gun out of his pocket. He dropped the gun and then he dropped the magazine," Gregory said, adding that he then fell again. Officers tried to taser him, but were unsuccessful. Smith fell yet again as he tried to jump a fence in a backyard in the 1200 block of Chippewa.

When officers caught up with him he threw a handgun over the fence, Gregory said. Smith was then arrested and officers recovered the discarded items.