Officials say Tuesday 's gunbattle began when militants opened fire on troops searching the area .