KABUL, Afghanistan — A firefight that raged for an hour between international forces and the Taliban in eastern Afghanistan killed four children who were in the area grazing their sheep and goats, local officials said.

The international forces apologized for the episode Tuesday and said an investigation was under way, but because bullets were flying from both sides, the international military stopped short of taking responsibility for the children’s deaths, which occurred on Sunday.

“In addition to the insurgents killed during the operation, ISAF may be responsible for the unintended, but nonetheless tragic, death of three Afghan civilians,” read a statement from the International Security Assistance Force.

Gen. John R. Allen, the ISAF commander, was quoted in the statement, saying: “I offer my sincerest condolences to the families of the civilians that were killed. Additionally, I am committed to ensuring we do the right thing for the families of those harmed and we will meet with them personally to offer a condolence payment and express our deep regrets.”