The plot's central turn is the psychological transformation of Fred C. Dobbs. After the trio successfully mines a significant amount of gold, Dobbs's greed metastasizes into acute paranoia. He becomes convinced his partners, Curtin and Howard, are plotting to kill him and steal his share. The tension escalates until another prospector, an American named Cody (Bruce Bennett), stumbles upon their camp. After a tense debate on whether to kill Cody, they are interrupted by a group of bandits led by 'Gold Hat' (Alfonso Bedoya). In the ensuing gunfight, Cody is killed.
Later, Howard is called away to a nearby Indian village to help save a sick child, leaving Dobbs and Curtin alone. Dobbs's paranoia reaches its peak, and in a pivotal scene, he shoots Curtin and leaves him for dead, absconding with all the gold. However, Curtin survives and is found by the villagers. Dobbs, fleeing alone and tormented by hallucinations, is then ambushed at a waterhole by the same bandits from before. In the film's ultimate ironic twist, the bandits kill Dobbs but, believing his bags of gold dust are merely sand, they tear them open and the powerful wind scatters the entire fortune across the desert. Howard and a recovered Curtin arrive later, only to find the empty bags. After a moment of stunned silence, they grasp the cosmic joke that has been played on them and erupt into hysterical laughter. Howard decides to return to the village where he is honored as a medicine man, while Curtin plans to return to the U.S., using what little money he has to help Cody's widow. The treasure, the source of all their suffering, is gone forever, reclaimed by the mountain.