All dates refer to the Third Age
For more than five millennia, the Balrog hibernated in its deep hiding place at the roots of the Misty Mountains or, more precisely, under the Mountains of Moria. It remained undisturbed for the Second Age and most of the Third. At long last, the mithril-miners of Dwarf-King Durin VI awoke it. Durin was slain by the creature.
It seems that the Dwarves attempted to make a stand against the Balrog, but its power was far too great for them to control. For a year, they attempted to hold their mansions Khazad-dûm at against it, but at last King Náin and many of his subjects were slain, and the survivors fled. At this time too, many of the Silvan Elves of Lórien left in fear of the Nameless Terror.
For some five hundred years, Moria (as Khazad-dûm became known) was deserted but for the Balrog. In around the year 2480, though, Sauron began to put his plans for war into effect, and as part of these, he sent orcs and trolls to infest the Misty Mountains and bar all of the passes. Some of these creatures came to Moria. It is unclear as to whether Sauron could have controlled the Balrog but it is certain that they would have been allied against the "common good". The Balrog did allow the orcs and trolls to remain in Moria while it dwelt there.
After the Battle of Azanulbizar, the climactic battle in the War of the Dwarves and Orcs that took place before the eastern gate of Moria in 2799 and was a victory for the dwarves, the victors did not conquer Moria when they saw the Balrog standing in the gate looking at them.
Despite an ill-fated attempt to recolonise Moria by Balin in 2989, Durin's Bane remained a dark and brooding menace in the ancient kingdom of the Dwarves, whose nature was hidden to the outside world.
In January 3019, the Fellowship of the Ring travelled through Moria on the Quest of Mount Doom. In Gandalf, the Balrog finally encountered a being of the same order and power as itself. As the two Maiar faced each other on the Bridge of Khazad-dûm, Gandalf broke the Bridge and the Balrog fell into the depths, but Gandalf too was drawn into the abyss.
Both survived the fall, and Gandalf pursued the Balrog for eight days through the deepest caverns beneath Moria. At last they came to the Endless Stair, and climbed the steps that led to the peak of Zirakzigil. There Durin's Bane fought its last battle - for two days and nights, the Balrog battled with Gandalf, but at last it was cast from the peak, and broke the mountain-side as it plunged to its doom. It is important to note that there was no clear winner in this battle as Gandalf and The Balrog killed each other, however Gandalf was resurrected and sent back to Middle Earth as Gandalf the White and with greater powers.