At least 15 people were killed in a militant attack on a security check post in north-west Pakistan, the military said on Friday.