A Fistful of Dollars
The Man With No Name (Clint Eastwood) (actually, we'll use "Joe," because that's what the coffin-maker calls him) plays hired gun to both sides of the gang war, bidding up his fee and switching sides frequently between Baxter (Wolfgang Lukschy) and Ramón Rojo (Gian Maria Volonté) until he gets a soft spot in his heart for Rojo's "girlfriend," and he frees her from her concubinage. When Rojo's men realize that Joe's responsible for the woman's escape, they capture him, and beat him within an inch of his life. Even as a bloody pulp, he retains his wits enough to escape, and Esteban Rojo (Sieghardt Rupp) concludes that he's that he's fled back to Baxter. Rojo's men murder Baxter's entire gang, but don't find Joe. Evenually, The Rojos realize that Silvanito the innkeeper (José Calvo ) is helping Joe, and they use him as the bait in a trap. Our hero returns for one last showdown, which leaves the Rojo gang dead. Joe heads out of the now-peaceful town, no richer (but certainly much wiser) than when he arrived.
This movie was is a remake of Yojimbo and and was later remade as Last Man Standing.