Hank Morgan runs a munitions and machinery factory in 19th-century Connecticut. He's struck by a crowbar during a dispute with the workers, and wakes up thirteen centuries in the past. A knight from King Arthur's Court takes him prisoner, and Arthur orders him executed. Hank escapes by "predicting" an eclipse and claiming that he could blot out the sun if they executed him.
Hank becomes the King's prime minister—a.k.a. The Boss—with a reputation for performing miracles. It makes him a number of enemies, notably the wizard Merlin who doesn't like Hank's new status as Arthur's bestie. Hank doesn't do much to discourage Merlin's resentment, and instead responds by destroying Merlin's tower with explosives and a lightning rod. In the process, he begins confiding in a young man named Clarence, who comes to serve as Boy Wonder to his Batman.
Soon after, Hank accompanies the Demoiselle Alisande a la Carteloise—thankfully nicknamed Sandy because that's a mouthful of a name—on a quest to save her mistresses from a band of vicious ogres. As it turns out, the mistresses are nothing but pigs whom the Demoiselle believes are enchanted. Hank plays along by buying the pigs and taking them home.
Along the way they meet a group of pilgrims journeying to a holy fountain. Their trip turns into a bummer when they find out that the fountain has gone dry. Merlin is already working on restoring it but Hank figures out that it's a simple leak and fixes it easily, bringing the office score to Hank: 2, Merlin: 0.
Hank then sets out on a new adventure, disguising himself as a peasant and travelling the country to see how the poor really live. Arthur decides to come with him, which ultimately causes problems since he can't act like a commoner to save his life. A nobleman captures them and plans to sell them into slavery. When Hank escapes, they intend to hang him, the king and their fellow slaves, but at the last minute Launcelot and the knights of the Round Table arrive to rescue them… riding bicycles provided by Clarence.
You'd think that Hank would be ready for a rest by then, but no such luck. A knight he insulted, Sir Sagramor, forces him into a duel, along with a passel of his buddies and enchanted weapons and armor from Merlin. Hank defeats them by pulling them out of their saddles with a lasso, then shooting them dead with a pistol when they try to up the ante.
Three years pass. Hank marries Sandy and has a baby with her; he also builds some roads, schools, and factories. Unfortunately, he forgets certain particulars of Arthurian literature, which ultimately catch up to him. Arthur is killed after starting a war with Launcelot, and the country revolts—Hank flees with Clarence, hiding in Merlin's cave with a small group of loyal teenage boys. They build fortifications, including land mines, Gatling guns, and electric fences, then battle to victory against an army of 30,000 sent to wipe them out.
After the battle, Hank goes out to tend to the wounded, one of whom recognizes him and stabs him in a flagrant display of unsportsmanlike conduct. Clarence and the boys take him back to the cave, but Merlin has a last trick for them, and disguised as a woman, he puts Clarence in an enchanted sleep and leaves him and the others to die in the cave.
Back in the present, Hank lies on his deathbed, dreaming about Sandy but lost forever to the ancient world he helped create.