Ex-lawman turned rancher Jed Cooper (Clint Eastwood) is moving a small herd of cattle when a group of nine men on horseback, led by Captain Wilson (Ed Begley Sr.), ride up and accuse him of having stolen the cattle and killed their owner. Refusing to believe his account, they string him up by the neck and leave him for dead, but they don't do the job right. Cooper is dangling there, barely alive, a few minutes later when Deputy U.S. Marshal Bliss (Ben Johnson) spots him and cuts him down. He survives the next few days in Bliss' tumbleweed wagon with the other prisoners, and is later cleared of any wrongdoing and released by Judge Fenton (Pat Hingle), just in time to witness the hanging of the man who really murdered the owner of the cattle and took Cooper's money. Cooper still wants revenge on the nine men who tried to hang him, but Fenton insists that he leave the bringing of them to justice to his deputy marshals. As it happens, Fenton is in desperate need of deputy marshals for the territory that he oversees, and he also knows that Cooper was a good lawman. Cooper, in turn, is now broke and in need of a job, and does want to see justice done. They strike an uneasy bargain, Cooper agreeing to wear a badge and bring in the men he's looking for -- alive -- for trial. The latter proves easier said than done, however, when the first of them that he spots tries to draw on him when he makes the arrest. One of the hanging party, Jenkins (Bob Steele), soon turns himself in and provides the names of the others. Cooper takes Stone (Alan Hale Jr.) alive, but the hapless blacksmith is later shot by the local sheriff (Charles McGraw) while trying to escape. The other men, led by Wilson, have no intention of dying, or even being brought to trial, without a fight. Two of them go on the run out of the territory, while Wilson and two of the others decide to take the law into their own hands once again. Meanwhile, Cooper becomes a hero when he single-handedly brings back a trio of rustlers who are also guilty of murder. This leads to Cooper's first confrontation with Judge Fenton, who, in a gripping scene, explains why it is essential that he be as seemingly quick to hang a man as he is. Unless the people are convinced that the law will do its job -- including hanging men who deserve it -- they will keep taking the law into their own hands and there will be more lynch mobs like the one that tried to kill Cooper. In the course of his quest for justice, Cooper also makes the acquaintance of Rachel (Inger Stevens), a young woman with her own search for justice, haunted by her own ghosts, and the two of them are drawn together, no more so than when Wilson and two of the others try to gun Cooper down in cold blood. The final confrontation between Cooper and Wilson escalates in violence to its savage, irony-laced conclusion.