FIRING A gun in the air is stupid. Pointing it at the cops is deadly.

A 30-year-old man learned that lesson late Tuesday night in North Philadelphia, when he decided to pop off some rounds from a high-capacity 9 mm pistol, police said.

When 22nd District officers responded to Berks Street near 20th about 11:30 p.m. and ordered the man to drop the gun, he aimed it at them instead, said police spokesman Lt. Ray Evers.

One officer fired two shots from his .45-caliber Glock, striking the man in the head and killing him.

"It's around New Year's. Maybe he thought he was having a good time," Evers said of the gunman. "He paid for it."

Police recovered five spent shell casings at the scene from the Intratec AB-10 - a variant of the TEC-9 - and found 23 rounds in the magazine and one in the chamber, Evers said.

"It's definitely a high-capacity magazine," Evers said. "You don't point a gun at the cops. They told him to drop it and he didn't."

Evers said yesterday that the gunman did not fire at the responding officers, as police originally reported soon after the incident. His name has not yet been released.

As is standard, the officer who fired his weapon has been placed on administrative duty while Internal Affairs investigates.

Evers said the gunman had an arrest record. It is unclear yesterday why he was outside shooting the gun.