KABUL, Afghanistan — Only two days after joint operations between American and Afghan forces were said to be returning to normal, five people — two Americans and three Afghans — were killed when a pitched battle broke out between soldiers of the two sides, American and Afghan officials said Sunday.

Afghan officials said that the clash on Saturday was a misunderstanding and that the Americans apparently attacked an Afghan National Army unit in error. A top coalition officer said the Americans were attacked first in what might possibly have been an insurgent attack. Nonetheless, he expressed regret for what ensued.

An initial statement from the NATO-led International Security Assistance Force, commonly referred to as ISAF, on Sunday described the episode as “a suspected insider attack,” which killed a foreign soldier and a civilian contractor. If so, that would bring to 53 the number of coalition forces killed in the so-called insider attacks this year.

Whatever happened, the episode clearly was another in a series of setbacks this year, and particularly in the last month, in relations between the American and Afghan militaries. It comes at a delicate moment, when all of the American surge reinforcements have only recently left the country, and NATO has been trying to transfer ever greater responsibility to a growing Afghan military.