A tiny muddy town is dominated by a feud between mexican bandits, and the Klan, led by Major Jackson. A stranger dragging a coffin, Django (Franco Nero) arrives in town. Django wants revenge because years ago Jackson killed his wife and son. Django kills 5 of Jackson's men rescuing Maria, a prostitute, in a gully outside town, and then 5 more when they come after him at the saloon. Jackson sends 40 men. Django has a machine gun in the coffin, and mows them down, with the last few fleeing desperately.
With the Klan out, the mexican bandits take over the town. They are impressed with Django, and grateful he killed all Jackson's men. Their leader, Rodriguez, knows Django from long ago, when Django saved his life. Django proposes they join him in robbing gold from a fort over the border in Mexico. Rodriguez is reluctant to give Django his share of the gold. Django breaks in and steals the gold. He escapes with Maria and the coffin full of gold.
The coffin falls off the wagon and sinks into quicksand, with the gold. The bandits catch them and shoot Maria. They smash Django's hands, breaking all the bones. Meanwhile, Jackson has led the mexican army to where the bandits are. A large army kills all the bandits. Jackson and his last 5 henchmen go to the cemetery looking for Django. Django has broken the trigger guard of his gun, so he can fire it by hitting the hammer with his palm. He shoots and kills Jackson and the last 5 Klansmen.
Thanks Joseph C!