In the crypt of the lich
Zagig Yragerne and his companions break into the crypt of Lyzandred. Zagig stays a while to learn from the lich — lessons he will later pour into Castle Greyhawk.
Zagig's castle and its endless dungeons.

Begun by Zagig Yragerne in 320 CY on a hill near Free City of Greyhawk, the castle sits atop a maze of dungeons that its mad builder expanded for a century. He imprisoned nine demigods beneath it, Iuz the Evil among them. Abandoned after 421 CY, it has drawn adventurers ever since.
Castle Greyhawk is the most famous dungeon of the Flanaess and, arguably, of the whole history of Dungeons & Dragons. Above ground stand the crumbling ruins of three towers – the Tower of Zagig, the War Tower and the Tower of Magic – along with temples, barracks and halls. Below lies a sprawling, many-levelled labyrinth that the mad archmage Zagig Yragerne filled with traps, riddles, jokes, monsters and treasure. For generations it has drawn adventurers from across the continent, and the wealth carried out of it has helped make the city of Free City of Greyhawk rich.
Zagig began building the castle around 320 CY, about the time he became Lord Mayor of Greyhawk, and ruled the city from it for roughly a century, expanding the dungeons all the while. Then he abandoned it and vanished in 421 CY. For years rumours of a curse kept people away, until northern barbarians plundered part of its treasure and their success drew dwarves, elves and adventurers of every kind. Zagig returned at times: with his apprentice Tasha (better known as Iggwilv) he bound the demon lord Fraz-Urb'luu in the depths, and in 505 CY he imprisoned the demigod Iuz the Evil in a godtrap beneath the castle. Iuz was one of nine demigods held there to fuel Zagig's own ascension to divinity as Zagyg. The farming goddess Merikka was another of them. In 570 CY the warrior Robilar freed Iuz, and most of the other captives escaped as well.
The surface ruins are mostly abandoned, but not empty: kobolds, bandits and stranger things lurk among them, and the old temple of Boccob once held the Regalia of Neutrality, goal of countless pilgrims. Below, the dungeons stretch through dozens of levels and sub-levels, from the twisted maze of Zagig's Gauntlet to deep vaults and magical prisons. Many passages are deliberately absurd – Zagig's humour is as dangerous as his malice. Different sources map the depths differently, and the castle's reputation is that no one has ever seen all of it.

Castle Greyhawk began as Gary Gygax's home campaign dungeon in the early 1970s, co-run with Rob Kuntz; famous characters such as Mordenkainen, Tenser and Robilar were born in its corridors. The original was never published as such. Official versions followed instead: a tongue-in-cheek adventure titled “Castle Greyhawk” (1988), the more serious “Greyhawk Ruins” (1990) and “Expedition to the Ruins of Greyhawk” (2007). Gygax later began his own treatment under the name Castle Zagyg.
Zagig Yragerne and his companions break into the crypt of Lyzandred. Zagig stays a while to learn from the lich — lessons he will later pour into Castle Greyhawk.
Zagig Yragerne bribes the entire Oligarchy and is elected Mayor of Free City of Greyhawk. That summer he starts building Castle Greyhawk.
Zagig Yragerne bets an Orb of Dragonkind in a poker game beyond the planes and wins a fortune. It pays for Castle Greyhawk.
On 8 Coldeven Zagig Yragerne misses a meeting of Greyhawk's Oligarchy and is never seen in public again. Deep beneath Castle Greyhawk he imprisons nine demigods and uses their opposed powers to make himself a god.
Word spreads that Castle Greyhawk stands unguarded. The treasure carried out of it starts a second adventuring boom, and by 430 Free City of Greyhawk builds new walls around what becomes the New City.
Zagig Yragerne, with the help of the archmage Heward, captures Iuz the Evil and locks him beneath Castle Greyhawk beside other captive demigods. Using their opposed powers he completes his own ascension and becomes the demigod Zagyg. In Furyondy the fear of Iuz splits the nobility.
Inspired by Zagig's old Company of Seven, Mordenkainen founds an adventuring company, the Citadel of Eight. Robilar uses loot from Castle Greyhawk to build the Green Dragon Inn. In the east, orcs and gnolls sweep down from the Rakers into the Bone March.
Adventurers blunder into the prison of the demon prince Fraz-Urb'luu beneath Castle Greyhawk and set him free.
Murlynd, Robilar, Tenser and Terik find the Crook of Rao beneath Castle Greyhawk. They lose it again when they flee the Isle of the Ape and leave all their belongings behind.
Mordenkainen gives Robilar the Blade of Black Ice and hints that Iuz the Evil, chained beneath Castle Greyhawk, could be slain. Robilar, Tenser and their companions free him — and fail. Iuz escapes, along with other imprisoned demigods, and returns to Dorakaa. Those who changed anything in his absence end up in his Road of Skulls. Robilar is exiled from Free City of Greyhawk.
Robilar is hired to escort monks of the Dark Moon into Castle Greyhawk to rescue the imprisoned demigod Zuoken. The rescue fails, but Robilar finds the Orb of Opposition — and trades places with his evil double, Bilarro.
Iuz the Evil tries to reach the Free City through the dungeons of Castle Greyhawk. Adventurers free the demigod Zuoken, imprisoned there since 505, and Robilar quietly returns after fifteen years away. To free troops against the Pomarj, Free City of Greyhawk hands the Cairn Hills back to Urnst.