It is a rare instance of a spaghetti western actually being shot in Mexico instead of substituting Spain or some similar European location.
In 1743 Mexico, a womanizing outlaw, the army deserter Leon Alastray (Anthony Quinn) is wounded and pursued by the Spanish military into a church. He is given sanctuary by a sympathetic priest (Sam Jaffe), who will not turn Alastray over to the military. The church authorities side with the army, and when the priest still refuses to hand Alastray over they send him to minister to a remote village, San Sebastian. The priest smuggles Alastray, who is proudly atheistic and anti-clerical, past the soldiers surrounding the church. Alastray feels guilty for what has happened to the priest, so accompanies him to the village to ensure he gets there safely. However he is angry and embittered throughout the trip.
They arrive at San Sebastian to find the church barely stands and the village apparently abandoned. The priest is killed by a marauding vaquero, but his ringing of the church bell brings the villagers out from their hiding places in the surrounding hills. They hide there because they are regularly terrorized by Yaqui Indians. The villagers mistake Alastray for a priest. He at first denies it and is scornful of them, but, guided by a persistent village woman, Kinita (Anjanette Comer), to whom he is attracted, decides to take on the role and organize the villagers. They are aided by the persuasive power of an accident the villagers think is a miracle.
Teclo (Charles Bronson) is a half-breed leader of the vaqueros. He pretends to side with the villagers, but in reality wants them to be scattered in the hills permanently, under his leadership. While Alastray organizes the men of the village to build a dam, the Yaqui attack and massacre many of the inhabitants of the village. The angry villagers order the priest out. Alastray leaves, with Kinita following. He tells her all his life he has fallen just short of achieving something meaningful, and sends her back to the village. A storm of approaching riders are heard, and the two take cover. They see Teclo and the Yaqui leader, Golden Lance (Jaime Fernández) together, and realize the alliance of those two means terrible things for the village.
Alastray goes to the capital and, using a previous love connection, obtains muskets, gunpowder and a cannon, which he takes back to the village. When the villagers see the weapons, they are encouraged and willing to fight. Alastray makes a peace overture to Golden Lance which is initially successful, but Teclo sabotages it and a Yaqui attack is inevitable.
On the eve of the battle the villagers ask Alastray to lead them in a Mass. He tells them he is not a priest, but they nonetheless accept him. Together they repel the Yaqui attack on the village, but they use up most of their gunpowder and their prospects appear grim. However a village boy out playing sees the vaqueros and the Yaquis gather in preparation for the next day’s attack. During the night Alastray and a few villagers set charges in a mountainside overlooking the gathering place, to explode rocks down onto the attackers.
The next morning Teclo rides by and sees the fuse to the charges, but the villagers kill him before he can do anything about it. The Yaquis gather below the rocks, and most, including Golden Lance, are killed when the charges are detonated. With the area pacified, government authorities come to administer the village. A military officer recognizes Alastray and sends soldiers to capture him. The villagers outwit the soldiers, getting them to pursue a decoy. Alastray flees on horseback in the opposite direction, with Kinita riding after him.
The original novel by Faherty had the hero a former soldier who became a Jesuit Friar, as opposed to the film's depiction of the hero as an army deserter and atheist bandit. The Indians in the novel were Comanche rather than Yaqui and the half-breed character played by Charles Bronson does not appear in the book.