Col. Cord McNally (John Wayne) loses his friend, Lt. Ned Forsythe, when Confederate thieves raid a Union army payroll train for it’s gold during the Civil War. McNally and his men take chase, but the pursuit thins them out until McNally is alone.
The Confederates capture McNally, but he eventually overpowers the leaders, Cordona and Philips, and the Union captures them instead. McNally tries to learn who the identity of the traitors are who sold out the Union. However, they won’t rat the men out, and are thrown into a northern prison.
Time passes, and the war ends. McNally visits the two upon their release from jail, and asks them about the traitors again. The three have a newfound respect for each other, but they can’t provide any names to McNally; only physical descriptions. McNally tells them that he will be in Blackthorne, Texas if they ever have any new information. Philips plans to return to his hometown of Rio Lobo, Texas which is nearby. The three men go their separate ways.
McNally arrives in Blackthorne, and meets Shasta Delaney from Rio Lobo. She demands Blackthorne’s sheriff, Pat Cronin, arrest a deputy from Rio Lobo for murder, but he doesn’t have jurisdiction.
Later at the town’s bar, McNally and Cronin chat while Shasta sits a few tables over. A posse from Rio Lobo arrives to arrest Shasta, but she shoots the leader, Whitey Carter, dead. A shootout ensues, and McNally and Cronin take out the rest of the posse. Cordona pops up, and shoots the last man.
He ids Whitey as one of the men who sold out the Union on the train robbery. Cordona is in town because Phillips needs help when a man named Ketcham starts cheating local ranchers out of their land. He also has Rio Lobo’s sheriff killed, and installed his own lackey, “Blue Tom” Hendricks, as sheriff.
McNally, Cordona, and Shasta head out to Rio Lobo, and find the townsfolk living in terror. Hendricks arrests Philips for stealing his own horses, and keeps him as a bargaining chip against his father who won’t hand over his land.
McNally learns Ketcham is Union Sergeant Major Ike Gorman, the second traitor he’s looking for. He tracks Ketcham down with the help of Philips’ father, and forces him to sign back the ranch deeds to their rightful owners.
They head back to Rio Lobo, and order Sheriff Hendricks and his men out of the jail or they will kill Ketcham. Meanwhile, Cordona races off to find the US Cavalry so they can take possession of Ketcham. Unfortunately, Hendricks’ men capture Cordona on the way. They bring him back to the jail to trade him for Ketcham. A gunfight ensues that leaves McNally wounded, and Ketcham, Sheriff Hendricks, and most of his men dead.
With the town liberated, life returns to normal.