Bank robber Jim Larsen is handcuffed to Deputy Marshal George Allison on his way to prison. Larsen feels he was only caught because he used a partner; the next time will be singlehanded. Boarding the train, Larsen overpowers the deputy, takes his pistol and handcuffs him to the rear car. Larsen's younger brother Danny comes to free Larsen. Danny has brought Jim a horse and they flee. The deputy produces a hidden derringer. He mortally wounds Danny, who kills the deputy. The two board another train, hiding in the baggage car. After Danny dies, Larsen puts his body in a mail sack and throws it off the train.
Jim changes into his father's business suit, which Danny brought, and reboards the train as a passenger at the next stop. The only vacant seat is next to Alice, a six-year-old girl who was visiting her grandfather. The talkative Alice guesses that he must be a visiting mining inspector. Using the name Ray Kincaid, Larsen plays along and gathers information on the next town, Tangle Blue, Wyoming. Mark Riley, an earnest but inexperienced sheriff who is Alice's uncle, and a group of deputies stop the train to search for the deputy's murderer; they are satisfied with "Ray Kincaid the mining inspector" due to his travelling with Alice. The deputies say that a wanted poster (with Larsen's face on it) will arrive on the next day's train.
In town, Larsen/Kincaid meets Alice's widowed mother, Ellen Bailey. He attends a dance with Ellen, who says she wants to leave Tangle Blue. Though he tries to avoid getting involved with Ellen, they fall in love.
Mark is having problems with rich landowner Reed Williams fencing off open range government land. Larsen/Kincaid finds all the roads away from Tangle Blue are guarded by deputies who prevent anyone from leaving until the wanted poster comes. Desperate for cash, he decides to earn some money as a deputy for Mark. He proves his ability as a lawman by preventing a showdown between Williams' gang and Mark.
As part of his duties, Mark cuts down Williams' barbed wire fences, but Williams' men rebuild them. Mark reminds Larsen/Kincaid of Danny. Returning to town to drink, Williams and his gang menace Larsen/Kincaid, who beats up Williams in a fair fight, but Larsen/Kincaid is then worked over by Williams' gang. The next day, Larsen/Kincaid is the only deputy willing to go with Mark to cut down Williams' fence. They find it unrepaired; Mark prepares to go back to meet the train with the wanted posters, which leaves Larsen/Kincaid free to leave town by the very road he is supposed to guard. But then Purdy, one of Williams' hired men, arrives and repairs the fence. When Mark discovers this, he comes back to cut it again. Purdy draws a gun and is about to shoot Mark. Larsen/Kincaid see this and disarms Purdy, and then also shoots the barbed wire, which snaps back and entangles Purdy. Mark goes to meet the train, leaving Larsen/Kincaid to slowly untangle the wire around Purdy. Soon Williams and several of his men arrive and shoot at Larsen/Kincaid, who escapes on horseback back to town. Pursued, he defends himself from the roof of a boarded-up house. He kills several men, but is wounded and falls through the rotted roof. Losing his gun and injuring his leg, he struggles to crawl downstairs. Purdy, the last of Williams' men, jumps down through the hole in the roof and makes it to the top of the dark stairway, just as Williams gets the door open. Williams shoots the figure in the dark, killing Purdy. Larsen/Kincaid retrieves Purdy's gun and kills Williams.
When Mark and others arrive, one of the men looks at the unconscious Larsen/Kincaid, then at the wanted poster he is holding, and says, "He's the man we're after alright." Mark then says, "Well maybe, maybe not", as they take him to a doctor. Mark states that he will testify for Larsen/Kincaid at his trial.