KABUL—U.S. and Afghan troops turned their guns on each other over the weekend, leaving two Americans and three Afghan soldiers dead in an incident that highlighted the breakdown of trust following a recent spate of insider attacks.

Afghan officials said Sunday that a Taliban rocket landed near U.S. troops on patrol Saturday afternoon in eastern Wardak province. In response, they said, American forces—thinking they had come under attack from Afghan troops—fired on a nearby Afghan army post. The Afghan...