"Moria is the name of the old Dwarven City beneath the Misty Mountains. In the tongue of the Dwarves it was called: "Khazad-dûm". Moria was an amazing underground city consisting of many large halls, chamber, tunnels and stairs. It was Durin who founded the city and since then it grew and grew. The very valuable metal mithril could only be found in Moria and they had to delve deeper and deeper to find it. This is how they came into contact with a Balrog that had settled under the mountain. After the Balrog had killed Durin VI and his son Nain I, the dwarves left Moria. Soon evil creatures started inhabiting Moria and it became a place of dread. Many years later Balin tried to reconquer Moria and make it a dwarven stronghold again. He was also killed however and as The Fellowship was making its way through Moria they came across his tomb and found notes that told the dreadfull story about how Balin and his band were killed by the Balrog and the Orcs. Before they knew it The Fellowship was being chased by the Orcs and the Balrog and they had to flee out of Moria as soon as possible."

As they were being chased by the Orcs it was Legolas who first noticed the Balrog. I will give the full account as it is written in The Lord of the Rings.
'A Balrog,' muttered Gandalf. 'Now I understand.' He faltered and leaned heavily on his staff. 'What an evil fortune! And I am already weary.' The dark figure streaming with fire raced towards them. The orcs yelled and poured over the stone gangways. Then Boromir raised his horn and blew. Loud the challenge rang and bellowed, like the shout of many throats under the cavernous roof. For a moment the orcs qualed and the fiery shadow halted. Then the echoes died as suddenly as a flame blown out by a dark wind, and the enemy advanced again. 'Over the bridge!' cried Gandalf, recalling his strength. 'Fly! This is a foe beyond any of you. I must hold the narrow way. Fly!' Aragorn and Boromir did not heed the command, but still held their ground, side by side, behind Gandalf at the far end of the bridge. The others halted just within the doorway at the hall's end, and turned, unable to leave their leader to face the enemy alone. The Balrog reached the bridge. Gandalf stood in the middle of the span, leaning on his staff in his left hand, but in the other hand Glamdring gleamed, cold and white. His enemy halted again, facing him, and the shadow about it reached out like two vast wings. It raised the whip, and the thongs whined and cracked. Fire came from its nostrils. But Gandalf stood firm.
'You cannot pass', he said. The orcs stood still, and a dead silence fell. 'I am a servant of the Secret Fire, wielder of the flame of Anor. You cannot pass. The dark will not avail you, Flame of Udûn. Go back to the shadow! You cannot pass.'
The Balrog made no answer. The fire in it seemed to die, but the darkness grew. It stepped forward slowly on the bridge, and suddenly it drew itself up to great height, and its wings were spread from wall to wall; but still Gandalf could be seen, glimmering in the gloom; he seemed small, and altogether alone: grey and bent, like a wizened tree before the onset of a storm. From out of the shadow a red sword leaped flaming.
Glamdring glittered white in answer.
There was a ringing clash and a stab of white fire. The Balrog fell back and its sword flew up in molten fragments. The wizard swayed on the bridge, stepped back a pace, and then again stood still.
'You cannot pass!' he said.
With a bound the Balrog leaped full upon the bridge. Its whip whirled and hissed.
'He cannot stand alone!' cried Aragorn suddenly and ran back along the bridge. 'Elendil!' he shouted. 'I am with you Gandalf!'
'Gondor!' cried Boromir and leaped after him.
At that moment Gandalf lifted his staff, and crying aloud he smote the bridge before him. The staff broke asunder and fell from his hand. A blinding sheet of white flame sprang up. The bridge cracked. Right at the Balrog's feet it broke, and the stone upon which it stood crashed ito the gulf, while the rest remained, poised, quivering like a tongue of rock thrust out into emptiness.
With a terrible cry the Balrog fell forward, and its shadow plunged down and vanished. But even as it fell its swung its whip, and the thongs lashed and curled about the wizard's knees, dragging him to the brink. He staggered and fell, grasped vainly at the stone, and slid into the abyss. 'Fly, you fools!' he cried, and was gone."