He suspended Holy Roman Emperor Frederick II for not carrying out the Sixth Crusade that he had promised at his coronation on 22 November1220. He then excommunicated Frederick, and threatened to depose him when he complained; Frederick’s army marched on the Pope, lost in the field, and Frederick had to beg for absolution. In June 1232, a popular revolt in Rome caused Gregory to flee to Anagni. Frederick came to his aid, and the two reconciled to a point, but in 1239 hostility broke out between the them, leading to a war that lasted until Gregory’s death.