Plot
A gang of bandits led by Calvera periodically raids a poor Mexican village for food and supplies. After the latest raid, during which Calvera kills a villager, the village leaders decide to consult the only man they believe has the wisdom to help them, an elder who lives as a hermit outside the village. The elder advises them to fight back and buy weapons, and if they have no money for weapons, to seek help from other towns where weapons can be obtained.
They send three villagers carrying their few objects of value to try to barter for weapons. In a town just inside the United States, the villagers find and approach gunslinger Chris Adams. Chris advises that they instead hire gunfighters to defend the village, as "men are cheaper than guns."
At first agreeing only to help them recruit, Chris eventually leads the group. Despite the meager pay, Chris finds five willing gunmen. They include Vin Tanner, a gunfighter gone broke from gambling; Chris' friend Harry Luck, who assumes Chris is hiding a much bigger reward for the work; the Irish Mexican Bernardo O'Reilly, who has fallen on hard times; Britt, an expert in both knife and gun who joins purely for the challenge involved; and the dapper, on-the-run gunman Lee, plagued by nightmares of fallen enemies and so haunted that he has lost his nerve for battle. On their way to the village, they are trailed by the hotheaded Chico, an aspiring gunfighter whose previous attempts to join Chris had been spurned. Impressed by his persistence, Chris allows him into the group.
Arriving at the village, they work with the villagers to build fortifications and train them in combat. They note the lack of young women in the village until Chico stumbles upon Petra and discovers the women were hidden in fear that the gunmen would rape them. The gunmen begin to bond with the villagers, and Petra pursues Chico. When Bernardo points out that the gunmen are being given the choice food, they share it with the village children.
Three of Calvera's men are dispatched to reconnoiter the village; due to a mistake by Chico, the seven are forced to kill all three. Some days later, Calvera and his bandits arrive in force. The seven and the villagers kill eleven gang members and run the rest out of town. The villagers celebrate, believing Calvera will not return. However, Chico infiltrates Calvera's camp and learns that Calvera will return, as his men are short of food. Some villagers fear reprisals and call for the gunfighters to leave. Although some of the seven waver, Chris insists that they stay.
The seven ride out for a preemptive raid on Calvera's camp but find it abandoned. Returning to the village, they are captured by Calvera and his men, who have colluded with some of the villagers to sneak in and take control. Calvera spares the seven's lives, believing they have been disillusioned by the betrayal and fearing reprisals from their friends across the border.
Preparing to depart, Chris and Vin admit they have become emotionally attached to the village. Britt declares that no man will take his gun and see him ride away. Chico insists that he hates the villagers; when Chris points out he grew up as a farmer as well, Chico angrily responds that it is men like Calvera and Chris who made the villagers what they are.
The gang escorts the seven gunmen from the village and returns their weapons. The seven debate their next move. All agree to return and fight, except Harry, who believes the effort is futile and suicidal.
The gunmen infiltrate the village and a gunfight breaks out. Harry, who has had a change of heart, returns in time to save Chris's life but is himself fatally shot. Harry pleads to know what they were fighting for before he dies, and Chris lies about hidden gold to let Harry believe he died for a fortune. Lee finds the nerve to burst into a house where several villagers are being held, shooting their captors and releasing the prisoners to join the fight, but he is gunned down as he leaves the house. Bernardo, shot protecting the boys he befriended, tells them as he dies to see how bravely their fathers fought. Britt dies after killing many bandits and exposing himself from cover. Chris shoots Calvera, who asks why he came back for the village before dying. The remaining bandits flee.
Chris, Vin, and Chico bid farewell to the village elder. The elder tells them that only the villagers have won, whereas the gunslingers are "like the wind, blowing over the land and passing on." As they pause for one last glance back at the village, Chico decides to stay with Petra. As Chris and Vin pass the graves of their fallen comrades, Chris admits the elder was right.