Consider a situation where a country is partially occupied by another. An army unit strikes across a border town of the occupying force. Their military objective is to destroy an enemy defensive unit, and then retreat back. They do that very successful, and unexpectedly their attack also triggers the collapse of the whole defence of the town. An angry mob uses this opportunity to breach the borders and enter the border town in large numbers. The mob indulges in rioting, looting and killing, taking out their anger at civilians of the occupying country. The army unit had never prepared for this scenario, and choose to ignore the actions of their civilian country men and focus on their military objective.
Under such a scenario, will the Army unit be culpable for the possible war crimes committed by a mob of their countrymen who are civilians? Note that the army hadn't gone to occupy the town. And, realistically, all they could have done is only to partially restrain the mob, without violence, and they were outnumbered.