The story follows a plot by a secret brotherhood, the Unique and Supreme Lodge of the Elucidated Brethren of the Ebon Night, to overthrow the Patrician of Ankh-Morpork and install a puppet king, under the control of the Supreme Grand Master. Using a stolen magic book, they summon a dragon to strike fear into the people of Ankh-Morpork.
Once a suitable state of terror and panic has been created, the Supreme Grand Master proposes to put forth an "heir" to the throne, who will slay the dragon and rid the city of tyranny. It is the task of the Night Watch– Captain Vimes, Sergeant Colon, Corporal Nobbs, and new volunteer Carrot Ironfoundersson – to stop them, with some help from the Librarian of the Unseen University, an orangutan trying to get the stolen book back.
The Watch is generally regarded as a bunch of incompetents who walk around ringing their bells without accomplishing anything, which is largely accurate. Carrot's arrival changes this; Whereas the existing officers are either cynical, incompetent, mildly crooked or all three, Carrot is honest, straightforward and idealistic. Additionally, he is 6'6" tall and enormously strong. Having memorized the Laws and Ordinances of the Cities of Ankh and Morpork, on his first day he tries to arrest the head of the Thieves' Guild for theft (the Thieves' Guild is permitted a quota of legally licensed thieving, a concept that the book of ancient Laws does not take into account). Brought up as a dwarf, a literal, dutiful people, his absolute dedication and conscientiousness unnerves his colleagues who view it as bordering on the suicidal in the face of the reality of Ankh-Morpork life. Carrot's policing style is reminiscent of traditional idealized portrayals of British police, such as Dixon of Dock Green, but astoundingly, it actually seems to work.
Carrot's enthusiasm strikes a chord with Vimes, who decides that the Watch should try to carry out its ostensible duties. Vimes begins investigating the dragon's appearances, which leads to an acquaintance with Sybil Ramkin, a breeder of swamp dragons. Ramkin gives an underdeveloped dragon, Errol, to the Watch as a mascot.
The leader of the Elucidated Brethren is initially successful in controlling the dragon, but he has not accounted for the dragon's own abilities. The banished dragon returns, and makes itself king of Ankh-Morpork (keeping the head of the Elucidated Brethren as its mouthpiece) and demands that the people of Ankh-Morpork bring it gold and regular virgin sacrifices.
Shortly after, Vimes is imprisoned in the same cell as the Patrician, who has been leading a relatively comfortable life with the help of the rats he uses as spies. The Librarian helps Vimes to escape and he runs to the aid of Sybil, who has been chosen as the first virgin to be sacrificed. The Watch's swamp dragon, Errol, reorganises his digestive system to form a supersonic jet engine and fights the king, eventually knocking the king out of the sky with a shock wave. As the assembled crowd closes in on the king for the kill, Sybil tries to plead for its life. Carrot instead places it under arrest, however Errol lets the dragon escape, revealing that the dragon is in fact female, the battle between the two being a courtship ritual.
Sam Vimes proceeds to arrest the Supreme Grand Master (Lupine Wonse, the Patrician's secretary) but accidentally causes the man's death when he tells Carrot to "throw the book at him." The man was attempting to summon another dragon, and dies from falling off a broken floor after being hit by the Laws and Ordinances of Ankh-Morpork .
The Patrician is reinstated as ruler of Ankh-Morpork, and offers the Watch anything they want as a reward. They ask only for a modest pay raise, a new tea kettle, and a dartboard.