A government official said three militants were killed in the gunfight .