PESHAWAR, Pakistan — More than 100 militants stormed a Pakistani security post close to this provincial capital on Tuesday night, one of the heaviest attacks in recent months, a senior police official said.

Heavily armed insurgents, bearing rockets and light artillery, rushed the post at Sangu Mera on the outskirts of the city and near the Khyber region of Pakistan’s lawless tribal area, said the city’s police chief, Liaqat Khan.

After a nearly five-hour battle and deployment of reinforcements to assist the police and paramilitary soldiers stationed at the post, the militants were pushed back “dragging bodies of their men,” Mr. Khan said. He said that two policemen and 15 militants were killed.

The checkpoint was recently installed to protect Peshawar from an increase in attacks by militants against security forces, Mr. Khan said.