During the middle ages, there was a constant back and forth between the church in Rome and local political authorities over who would control the power. At one point, Pope Gregory VII declared that as God was the sole source of authority, the Pope could choose to remove any sitting emperor. For his part, Holy Roman Emperor Henry IV of Germany felt that he could appoint church officials, and threatened to remove his support for Gregory as Pope. Gregory excommunicated Henry, and in 1077 (here by Jojo), Henry traveled to Canossa, where he did penance and received forgiveness from the Pope. A few years later, though, Henry invaded Rome and forced Gregory to flee.