Pope Gregory IX
The emperor then went on to invade the Papal States, and was excommunicated by Pope Gregory IX.