The assault took place in the northwestern city of Peshawar, about 200 metres (yards) from the U.S. consulate but there was no indication the compound was the target.
Abdul Majeed Marwat, a commander for the Frontier Constabulary, said he was the target. Two members of the force and eight civilians were killed and 15 people were wounded, said the security officials.
Pakistan's Taliban have carried out similar attacks on security forces as part of their campaign to topple the U.S.-backed government and impose their brand of Islam.
Peshawar, an ancient trading city and gateway to the Khyber Pass and Afghanistan, has been a focus of militant violence.