The Old West town of Calendar, Colorado, springs up almost overnight when clumsy, hotheaded Prudy Perkins (Hackett) notices gold in a freshly dug grave during a funeral. Her father Olly (Morgan) becomes mayor of the new settlement. Other members of the town council (Henry Jones, Walter Burke) and he bemoan the town’s descent into chaos and corruption, and are tired of the tolls exacted on their gold shipments by the Danbys, a family of near-outlaws who control the only shipping route out of town. The town has no sheriff, as most people are too busy prospecting, and the few who have taken the job have been run out of town or killed.
Jason McCullough (Garner), a confident and exceptionally skilled gunfighter who says he is only passing through town on his way to Australia, sees Joe Danby (Dern) gun down a man in the town’s saloon. Needing money after encountering the town’s ruinous rate of inflation, McCullough takes the job of sheriff, impressing the mayor and council with his uncanny marksmanship. He breaks up a street brawl, and later at the Perkins house meets Prudy, despite her attempts to avoid him due to her embarrassing circumstances. McCullough arrests Joe and tosses him in the town’s unfinished jail, which lacks bars for the cell doors and windows, keeping the dimwitted Joe in his cell through tricks and psychology.
McCullough acquires a reluctant deputy in scruffy Jake (Elam), previously known as the “town character”. Joe’s arrest infuriates his father, Pa Danby (Brennan), who is not accustomed to his family being challenged. Pa Danby mounts various attempts to get Joe out of jail, and when those fail, sends in a string of hired guns, whom McCullough defeats with ease. Meanwhile, McCullough enlists Jake’s help in an unsuccessful attempt to prospect for gold, and spars romantically with Prudy.
After numerous failures to reassert himself over McCullough and the town, Pa Danby enlists a host of his relatives to launch an all-out assault. When the news reaches McCullough, he initially tells Prudy he has decided to simply leave town and resume his trip to Australia, but when she expresses her sincere approval of this sensible idea, he declares it to be cowardly and announces he is staying, instead. The rest of the townsfolk officially vote to stay out of the conflict, and not help in any way. Thus, the Danby clan rides in faced only by McCullough, Jake, and Prudy. After a lengthy but unproductive gunfight, McCullough bluffs his way to victory using Joe as a hostage and the old cannon mounted in the center of town. As all the Danbys are marched off to jail, the supposedly unloaded cannon fires, smashing Madame Orr’s, the town brothel, and scattering the resident prostitutes and the four civic leaders who were inside.
Sheriff McCullough and Prudy get engaged. In a closing monologue, Jake breaks the film’s fourth wall and directly informs the audience that they get married and McCullough goes on to become governor of the state of Colorado, never making it to Australia (although he reads about it a lot), while Jake becomes sheriff and “one of the most beloved characters in Western folklore”.