|Henry IV (center), with his sons Henry V & Conrad|
Henry was excommunicated again in 1084; however, this time he wasn't so penitent. He marched into Rome, deposed Gregory, and appointed his own pope, Clement III. The College of Cardinals had another idea, however, declared Clement III an "anti-pope," and appointed their own pope, Pope Urban II. Urban supported Gregory VII's ideas and opposed Henry, as did Pope Paschal II who followed him in 1099.
Henry was prepared to oppose the popes, but a further betrayal created worse trouble for him. His son, Henry (1086 - 1125; later Holy Roman Emperor Henry V). Sons in line for the throne often make designs on that throne before their predecessor departs by his own choice, and young Henry decided that his father's excommunication was good grounds for staging a rebellion.
In 1104, young Henry decided it was time to stand up and depose Henry IV. The Church was willing (naturally) to support the son against the father who had proven to be no friend to the papacy. Henry IV had been trying to maintain order in the Empire, and did not want a war. He agreed to a meeting to try to achieve a peaceful resolution; the meeting, however, was a ruse, and he was captured by his son's forces. Imprisoned in Böckelheim Castle in southwestern Germany, he was forced to renounce his creation of Pope Clement and to admit that he was unjustly hostile to Pope Gregory.
Henry IV was German, however, and Germany itself was not keen on having their king deposed and imprisoned by a teenager who then declared himself Holy Roman Emperor Henry V. In 1106, forces loyal to Henry IV opposed his son and the pope and freed Henry IV from his prison. Henry Senior started making alliances with other nations for support. Early in 1106, he defeated his son's forces, but he succumbed to an illness of several days and died on 7 August.
Because he was still excommunicated, his body was placed by order of the papal legate into an unconsecrated chapel until the excommunication was lifted in summer of 1111.
Henry V did become Holy Roman Emperor in his own right from 1111 until 1125