In the Colorado Territory, Jim is holed up in an attic and watches green-and-white dressed troopers with a lightning bolt insignia bring Artie out to be hung. Artie is disguised as prisoner Aaron Addison, and insists that he's innocent. As Jim prepares a special rifle to shoot his partner, Artie tells the governor's secretary, a scarred man named Deke Montgomery, that he's innocent. Montgomery demands the name of the man who sent him and Artie starts to comply, but Jim shoots him before he can finish. The troopers open fire and more close in on the attic. Jim uses powder to burn through the wooden floor and down two floors into a wagon filled with hay.
The troopers' leader, Captain Dansby, organizes the pursuit. Jim takes refuge in a garden house adjoining a manor and discovers that a woman is inside. She introduces herself as Henriette Faure and explains that the troopers are the Black Legion, and that Governor Winston E. Brubaker uses them to maintain martial law. A trooper comes by and Henriette assures him that she's alone. Once the trooper leaves, Henriette shows Jim a secret trapdoor and tells him leads to the service door behind the governor's manor. She suggests she might call the troopers in and Jim gives her a parting kiss in thanks.
Jim discovers that the other end of the tunnel is guarded, but notices a hidden panel. He opens it and finds himself in Brubaker's office. As the panel closes behind the agent, Montgomery and two of his men come in. He wonders how Jim got in and the agent claims that just wandered in, and he's come to see the Brubaker to ask for clemency for the disguised Artie. The governor's secretary informs him that he's too late and the body has been taken to the morgue, and then calls in Dansby to interrogate Jim. Jim fights his way out, leaps past the window, and rides off on his horse.
At the town morgue, two attendants store Artie's body and leave. Jim emerges from another drawer and gives his partner a drug to revive him from the coma induced by the drug on Jim's earlier bullet. Meanwhile, a woman named Catherine Kittridge arrives to collect Artie's body. When an attendant goes to get Artie, Jim quickly knocks him and puts him in Artie's drawer. Artie fakes being drunk and Jim escorts him out, but the troopers here the attendant yelling and give chase. The agents ride out of town on a wagon and then jump off, letting it continue on with the troopers in pursuit. Artie explains that he was framed for murder while undercover because he was asking too many questions. Catherine is the only one who has stood up to Brubaker and the Black Legion.
Catherine returns to her estate and finds Dansby waiting for him. He insists on searching and warns her that if she doesn't return his affections, she could be declared an enemy of the state. Catherine slaps him and goes in, but has no choice but to let Dansby conduct his search. As he does, Catherine spots Jim hiding in the closet but remains silent. When Dansby approaches the closet, Catherine starts flirting with him but says she has a headache and they should meet later. Once Dansby leaves, Catherine draws a gun and orders the agents to come out. They explain who they are and Artie's fake death, and that Grant has sent them to investigate her father Dan's charges of corruption against Brubaker. They have a warrant, but Catherine warns them that Brubaker and the Black Legion have complete control of the territory. Her father is in prison on false charges and the agents offer to rescue him. However, they admit that Grant won't risk another civil war by sending in troops, so they'll do it themselves.
For the first part of the agents' plan, Jim goes to the governor's office and serves Brubaker with his warrant. However, Montgomery has a warrant for Jim's murder of Artie and insists that his has precedence over Grant's. Brubaker leaves with his secretary, Henriette, and nervously takes a drink while wondering if everything will work out. Meanwhile, Dansby arrests Jim and assures him that hi men can handle the Seventh Cavalry if they need to.
At the trial, Jim's defense attorney, a local lawyer, wisely remains silent. Jim is forced to defend himself and asks for a dismissal, insisting that he simply carried out the sentence of the court and executed Artie a few minutes early. However, the prosecutor has Montgomery testify that he had just found evidence to clear Artie, and was releasing Artie when Jim shot him. Now that they have the evidence that clears Artie, the disguised Artie enters the courtroom and confirms that he's still alive, clearing Jim of any murder charge.
The jury finds Jim innocent despite the prosecutor's attempts to sway them with veiled threats. When the prosecutor appeals to the judge to set aside the verdict, Montgomery steps in and says it should be accepted. Everyone makes a quick exit and Jim and Artie spot troopers outside. Artie switches disguises and goes out the front while Jim makes it out the back after taking care of a trio of Brubaker's thugs.
Jim finds Catherine and they meet in a stable to avoid being spotted. She has already passed on a message to Artie saying to meet Jim at the garden house that night. However, Catherine doesn't believe that there is anything the agents can do, now that the governor has his Black Legion. Two troopers come in and Jim kisses Catherine, posing as a pair of lovers. Once the troopers leave, Jim assures Catherine that they'll arrest Brubaker and ship him to Washington on their train.
Montgomery goes to the governor's office to warn Brubaker that the agents will try and abduct him. Dansby figures they'll use the hidden entrance, and Montgomery orders a reluctant Brubaker to act as bait. They'll mine the tunnel and kill the agents when they come in. Once Montgomery and Dansby leave, Brubaker pours himself a drink and turns to Henriette for comfort.
That night, the agents enter the tunnel via the hidden door in the garden house. When Jim explains that Henriette told him about it, Artie warns his partner that the woman is planning to be Brubaker's wife. A steel panel closes, cutting off their exit, and they get to the far end of the tunnel just as the explosives go off.
Brubaker asks Henriette to marry him, but she warns that the public prefers him as a dashing bachelor and that they can marry him once he parlays his success into the Presidency. She leaves to get dressed for an upcoming rally and the agents enter via the secret panel and capture Brubaker.
The agents take Brubaker to the Wanderer via carriage. However, when they arrive, Brubaker confesses and says that Montgomery has been the mastermind behind his successful political career. Montgomery arrives, anticipating their successful abduction, and holds them at gunpoint. He explains that due to his disfigurement and intellect, he could never be governor much less President, but he's managed to be the power behind the throne. Disgusted, Montgomery dismisses Brubaker as a voice and face and asserts that he is the genius behind it all. Dansby arrives with his troopers and Montgomery leaves them to dispose of the agents while he take Brubaker to the rally. Once the two men leave, the agents make short work of Dansby and his men and ride to town.
At the rally auditorium, a desperate Catherine is waiting to shoot Brubaker. However, when the carriage arrives, she sees Brubaker having a nervous breakdown due to the stress. Montgomery goes inside to address the crowd while Jim and Artie arrive and realize what has happened. They go inside with Catherine and watch while Montgomery tells the crowd that assassins killed Brubaker, making him a martyr. Ranting and raving, he calls upon them to rise up and demand statehood, but the people see him for what he is and walk away. Soon only Catherine and the agents are left as Montgomery clutches at his face and insists that it was him all along.
Later, Catherine brings her newly-released father to meet with the agents at the Wanderer and celebrate. Jim passes on a letter from President Grant confirming that Dan has been appointed to pro tem territorial governor now that Brubaker is out. When Catherine privately asks Jim if he put in a good word for her father, he admits that he did, suggests that the new governor will need a secretary, and kisses her.