Blondie (The Good) is a professional gunslinger who is out trying to earn a few dollars. Angel Eyes (The Bad) is a hit man who always commits to a task and sees it through, as long as he is paid to do so. And Tuco (The Ugly) is a wanted outlaw trying to take care of his own hide. Tuco and Blondie share a partnership together making money off Tuco's bounty, but when Blondie unties the partnership, Tuco tries to hunt down Blondie. When Blondie and Tuco come across a horse carriage loaded with dead bodies, they soon learn from the only survivor (Bill Carson) that he and a few other men have buried a stash of gold in a cemetery. Unfortunately Carson dies and Tuco only finds out the name of the cemetery, while Blondie finds out the name on the grave. Now the two must keep each other alive in order to find the gold. Angel Eyes (who had been looking for Bill Carson) discovers that Tuco and Blondie meet with Carson and knows they know the location of the gold.
Set during the Civil War, three men search for a fortune in gold. One of these men is Angel Eyes, a cold blooded hired killer who was hired by a man to locate his partner who vanished with the gold but he doesn't tell Angel Eyes why he wants him. But Angel Eyes finds out while looking for the man and tells the man who hired him what he found out. But he kills him so he can get the gold himself. The other two men are Tuco and a guy he calls Blondie. Tuco is a bandit. Blondie captures him and turns him in for the reward. But when Tuco is about to be hung, Blondie saves him and they go off and do it somewhere else. After their latest attempt, Bloncie tells Tuco they've taken it as far as they can. He leaves Tuco and doesn't give him his share. Tuco tracks him down and makes walk across the desert. Later they come across a stagecoach filled with men who are dead wearing Confederate uniforms, Tuco finds a man dying who just happens to be the man Angel Eyes is looking for. He tells Tuco about the gold but before he could tell Tuco where it is he passes out. So Tuco goes to get some water but when he comes back, the man is dead. But Blondie is there and Tuco thinks the man told him where the gold is. So he nurses him back to health. They put on the uniforms and take the stagecoach. They come across some soldiers who they thought were Confederate but were actually Union so they take them prisoner and bring them to the Fort. Angel Eyes is there, an officer. When he learns Tuco took the identity of the man is looking for, he assumes he knows about the gold. So he talks to Tuco and he "gets" him to tell him about the gold but Blondie is the one who knows where it is. So he brings Blondie to him but he's not intimidated. So he agrees to take him to where the gold is. So the three of them head off to get the gold. But can they trust each other.