U.S. officials say troops came under attack , while looking for militants who were transporting foreign fighters between the two countries .