Yeah, most of his greatest works were wrote after he had lost almost all his hearing. Even when he wrote his first symphony when he was 30, his deafness was already pretty advanced. Actually at that time, he would sit down at a piano and play a C major chord with B in the bass. It would kill him cause he couldn't even hear the dissonace.
His deafness was caused by a deteriotation of a nerve in his ear.
"My whole life is a dark room...ONE BIG DARK ROOM" - a.f.i.