The film begins in 1910 when a successful aging U. S. senator Ransom Stoddard (James Stewart) and his wife of twenty-five years Hallie (Vera Miles) return to the small western town Shinbone, where they met, to attend the funeral of Tom Doniphon (John Wayne) a man known in the town as a good man but undistinguished. When a young local reporter presses Stoddard for an interview about why he has come to the funeral of a nobody like Doniphon, Stoddard begins a story that relates the history of the film in flashback. Stoddard tells us how when he came to the town as young newly-graduated attorney at law he was bullied by a local tough outlaw named Liberty Valence (Lee Marvin), a gunman employed by the local cattle cartel directed to keep the town in line so that the barons could monopolize the local resources to insure their beef industry. He first meets Valance when the stagecoach he is travelling in is ambushed by the outlaw and his companions.
Stoddard tries to stop him from robbing a woman but he is knocked out. When Valance discovers he is a law graduate,he whips him several times,before he and his friends wander off into the night. Early the next morning,Doniphon and his friend Pompey (Woody Strode) take the unconscious Stoddard into Shinbone to rest up at Hallie's place where she runs a steakhouse. Bumbling and cowardly marshal,Link Appleyard (Andy Devine) arrives and is horrified to find out that they want him to capture Valance. He tries his best to come up with excuses about how the jurisdiction prevents him from doing anything about it,which is what the residents have come to expect from him. On one boisterous night,newspaper publisher Dutton Peabody leaves his office and runs into Appleyard who is petrified because he knows Valance is in town. Peabody goes to the restaurant for dinner,where Stoddard is helping out in the kitchen as a way of earning his keep.
While he's washing the dishes,he's reading up on a law book about the marshal's jurisdiction and how he can get Valance. He finds some useful information and asks Hallie to read the good news,but she feels embarrassed as she can't read. Appleyard sneaks into the kitchen through the back door,nervously trying to keep out of Valance's way. He asks for a steak and sits down with Stoppard who tells him that he has he power to arrest Valance when he sees him,much to his dismay. Hallie asks Stoppard if he would be willing to teach her to read and he's happy to. Doniphon arrives all dressed up, with a cactus rose to see Hallie and isn't too happy to see her getting friendly with Stoddard. Pompy plants the rose for her,while Doniphon goes to sit with Peabody while he waits for his steak order. Valance and his men enter and as soon as Appleyard hears him,he rushes out of the back door.
The outlaws remove three men from their table and sit down for dinner. Stoddard comes out from the kitchen with Doniphon's meal and sees them. Valance laughs at him. As Stoddard tries to ignore him and walk passed him,Valance trips him up. Doniphon tells Valance to pick his steak up. To avoid a showdown,Stoddard angrily picks it up and Valance and his men leave. Stoddard realises that Doniphon was right. A gun is the only way to deal with people like Valance.
But he's disgusted that Doniphon was going to kill him over a steak and hates the idea that he fought his fight for him. Doniphon tells him Valance will be back for him at some point. He either better get a gun or get out of town. Stoddard says he's staying and he's not going to get a gun. Doniphon tells Hallie he's leaving town for a while to do some horse trading.
Stoddard teaches the people in the town how to read,and about history. He explains to them about the upcoming election and how important it is. Doniphon arrives with news about Valance. He's been recruiting gunmen for the big ranchers and has killed some people. They tried to bushwhack Doniphon but he killed one of them and got away. Doniphon reckons they'll arrive in town by the day of the election. He tells Hallie to go home and be safe but she tells him that he doesn't own her.
He leaves and Stoddard tells her that Doniphon is only trying to protect her. He goes off on a wagon and Peabody tells her that Stoddard has a gun that he's given him and he's been practicing with it to try and prepare for a showdown with Valance. Hallie tells Doniphon about this and he goes after him. After catching up with him,he takes him to his ranch and tells him that Hallie's his girl,and shows him the extension that he is having done on his home ready to settle down with her. Stoddard says there's nothing going on between them but Doniphon can tell she's starting to develop feelings for him. He also reckons Stoddard's bluffing about going up against Valance but Stoddard's adamant that he fully intends to. However he proves that despite practicing,he still cannot use a gun at all. Doniphon tries to teach him.
He tells him to put some paint cans up on a fence and shoots them,the final one covering Stoddard in paint. Stoddard is angry at him humiliating him as Doniphon laughs. But he explains that's the kind of behaviour to expect from Valance. Stoddard punches him in the jaw and goes off. On the day of the elections,Stoddard nominates Doniphon for the first delegate but he refuses. He already has his future planned with Hallie.
Doniphon nominates Stoddard. Valance arrives and threatens the townsfolk to nominate him. If they don't,he'll get hold of them when they're alone. But they still refuse to vote for him.
The only people that nominate him are his two sidekicks. Stoddard gets a lot of votes but Peabody gets the most. Valance confronts Stoddard. Doniphon tries to intervene but Valance tells him he's been hiding behind his gun long enough. He orders Stoddard to either get out of town or face him in the street. If he stays and hides,he'll go and get him.
As he leaves,Doniphon tells Stoddard it would be best to leave. Later that night,Peabody gets drunk in his office whilst writing the newspaper headlines. He goes off to the saloon to get some more alchohol. When he returns to his office and lights up the room,he finds Valance and his men waiting for him. They wreck his office and beat him to near death. As they go off to the saloon after firing gunshots in the street,Stoddard goes over to see Peabody. He tells Appleyard to go and tell Valance he'll be waiting for him in the street,while he goes off to get his gun from Hallie's. He fires and Valance dies.
A wounded Stoddard returns to Hallie who confides that she did not want him to leave. Doniphon comes in and sees Hallie and Stoddard together and apologizes to Hallie that he did not arrive in time to help. Doniphon returns drunken to his place where he torches it and would be content to die if Pompy did not rescue him from the burning house. When Stoddard is unanimously elected to a political career so he may clear the land of other outlaws, he defers, but then Doniphon comes forth to tell him that on that fateful night Valence fell due to a shot Doniphon fired from him across the street. When Stoddards ethical issues rise and he moves to tell the world the truth, Doniphon convinces him to keep the truth a secret and take a leading role to change the ways of the old West. Doniphon tells Stoddard that Hallie is Stoddard's girl now and since he taught her how to read and write, he needs to give her something to read and write about. Stoddard goes on to a stellar career making sweeping changes in the way the land is governed and Doniphon fades away. As Stoddard finishes his story, the reporter destroys his notes and insists that the myth of the West is more important to sustain than the sterilized truth, although the truth has freed the demons Stoddard and Hallie have carried with them since their time with Doniphon.
Stoddard returns to Doniphon's casket to leave with Hallie and notices a cactus rose on top of the casket. On the train ride back to the east, Stoddard asks Hallie if she would mind returning back to Shinbone to settle down and retire. Hallie says she would love to as her heart has always been there. Stoddard asks Hallie who placed the cactus rose on Doniphon's casket. Hallie says she did..