Aging gunfighter Jack Beauregard (Henry Fonda
), tired of being hounded by people who want to kill him for various reasons, wishes to retire and leave the country for Europe. While he is still trying to come up with the money needed for a ship's passage he encounters a strange and quirky man who just calls himself "Nobody" (Terence Hill
) and professes to be a fan of Jack.
Nobody, who is a formidable gunman in his own right, doesn't like the idea of his hero simply vanishing away silently. He wants the name of Jack Beauregard to become a true legend, written down in the history books, and for this purpose he has dreamed up a conflict of truly epic proportions: pitting Jack alone against the 150-man-strong bandit gang, called "The Wild Bunch".
Unable to believe that Nobody could be serious, Jack initially views Nobody as yet another rival gunman, who is just out to make a name for himself by killing Jack - but Nobody is indeed quite serious about his plan.
The potential for such a conflict exists because of one Mr. Sullivan (Jean Martin
), the owner of a worthless mine, through which the Wild Bunch is laundering stolen gold. Jack Beauregard's brother, called the Nevada Kid, used to be co-owner of the mine, until Sullivan killed him. Now Nobody is hoping that Jack will take revenge upon Sullivan, thereby earning the ire of the Wild Bunch.
Sullivan himself expects Jack to come gunning for him as well and has already sent goons after Jack to kill him, on previous occasions. Those were foiled by Jack himself on one occasion and by Nobody on another. When Sullivan wants to hire gunmen for another attempt on Jack's life, Nobody pretends to take the job and - after some confrontational banter and gun-play - warns Jack of the ambush waiting for him, helping him dispatch the other two gunmen lurking in hiding.
Jack, however, disappoints Nobody and defies Sullivan's expectations; he declines to exact blood vengeance for a brother who, he claims, was just as much of a crook as Sullivan. He merely corners Sullivan and takes off him the money he needs for his passage to Europe, then rides off along the train tracks toward New Orleans, where his ship is anchored.
Not to be dissuaded so easily, Nobody absconds with a gold transport train that runs along those same tracks. Jack suddenly finds himself being followed by a slow-moving train that keeps pace with his horse but refuses to let him approach - and the Wild Bunch is thundering toward them from the horizon.
Jack realizes that he can't escape the confrontation that Nobody has engineered and settles down, using the embankment of the tracks as cover, to fight off 150 bandits on his own. He remembers that, at an earlier point, he had seen some of the riders load up their saddle bags with dynamite, and is able to use the blinking of their gaudy decorations in the sunlight for aiming. He sets off several great explosions, cutting a huge swath through the bandit gang and reducing their number to a fraction of its former size.
When the confrontation settles down to a prolonged gunfight, with both sides hunkered down and shooting from behind cover, Nobody drives the train forward again, between the two opposing sides, and allows Jack to board. Together they drive off toward New Orleans, leaving the remnants of the Wild Bunch behind.
Now that Jack Beauregard's name in history is secured by a legendary victory, there is only one thing left to do, before he can leave for Europe: he must appear to die in battle. It turns out that even his strange choice of a name has been part of Nobody's plan for Jack all along - one staged duel in the streets of New Orleans and a public death scene later, the grave of Jack Beauregard bears the epitaph, "Nobody was faster on the draw."
Jack can board his ship in anonymity and says farewell to Nobody with a letter wishing him luck, now that the remainder of the Wild Bunch and aspiring gunmen looking for fame will be gunning for him instead of Jack, while the old rules of the west are changing around them in modern times. Even as the letter is read in voice-over, Nobody is shown dealing with these threats in his own uniquely quirky style, demonstrating that if anybody can handle himself, it's Nobody.