The first level of the dungeon appears to be an old ruin, but it's actually the youngest portion of the entire complex. Most of it was built by Duke Chordille for storage, keeping prisoners, and eventually to honor the goddess Glarias. As the subterranean portion of the keep expanded, the duke's workers found old chambers originally built by Queen Ryssa's dwarves. This allowed the duke's dungeon to connect to the other levels, although the duke kept the rest of the dungeon a secret from all but his most trusted confidants and forbade anyone to explore its depths for fear of rousing something dangerous (a wise move, really--the duke apparently knew something about the nature of dungeons).
After the duke's death and the razing of his keep, others utilized the underground level from time to time, often modifying its chambers to suit their needs. It was a large bandit lair for a few years, for example. The wizard Serrestique used a large portion of it for her own purposes during another period about a decade ago, until she mysteriously disappeared.