Calvera (Eli Wallach) is a Mexican bandito who, along with his men, raids several villages and takes whatever he wants. One of the villages, tired of all the thievery, decides to fight back. They send 3 members of the village across the border to Texas to buy guns. Instead, they find Chris (Yul Brynner), a gun for hire who is sympathic to their problem. He goes through the town to find other hired guns to help out, and ends up with six of them: Vin (Steve McQueen), Harry (Brad Dexter), Bernardo (Charles Bronson), Britt (James Coburn), Lee (Robert Vaughn), and Chico (Horst Buchholz).
The seven go to the village and teach the townspeople how to handle weapons and defend themselves. When Calvera and his men return, the seven and the villagers successfully fight them off. When they realize that they will have to constantly fight Calvera until either he or they are dead, the locals decide they don't have the stomach for fighting and allow Calvera and his men back into the village. Calvera takes the guns away from the seven and makes them leave. Once they are far enough away, he gives them their guns back and tells them to never return. The seven all decide that they won't run from a fight and return to the village.
When the seven return to the village they promptly engage in a gunfight with Calvera and his men, killing most of them. The villagers, seeing that they can get rid of Calvera once and for all, enter the fight and kill the rest of them. Calvera is killed in the gunfight, but so are Harry, Lee, Britt, and Bernardo. After the four are buried, the surviving three say their farewells and leave the village. Chico, who had fallen in love with one of the local women, changes his mind and stays to be with her. Chris and Vin go back across the border.