The Dictatus Papae: the pope may depose emperors, and the Roman church has never erred (1075)
The Dictatus Papae is a list of twenty-seven propositions copied into the register of Gregory VII. Among them: that the pope alone may be called universal; that he may depose emperors; that he may absolve subjects from their oath of fealty to an unjust king; that no one may judge him; and that the Roman church has never erred and never will err.
It is the programme of the papal monarchy, eight centuries before Vatican I. Not all of it became dogma, but it did become practice: the excommunication of a king could leave him without subjects, and the pope governed with that weapon. Unam sanctam would give it theological form.
Source