Raniero Capocci, also known as Ranieri, Rainerio da Viterbo (c. 1180-1190 – 27 May 1250) was an Italian cardinal and military leader, a fierce adversary of emperor Frederick II.
Capocci was born at Viterbo in 1180–1190. Few details exist about his early life, and his alleged adherence to the Cistercian Order, including the role of abbot in the Tre Fontane Abbey in Rome, is unconfirmed. He entered the Roman curia before 1215, the year in which Pope Innocent III sent him to the Abbey of Montecassino to investigate about abbot Adenulf's tenure. In 1216 Capocci was created cardinal deacon of Santa Maria in Cosmedin, and later became papal legate to Lombardy.
Innocent's successor, Honorius III, appointed Capocci as rector of the Duchy of Spoleto, and later of the areas of Assisi, Nocera Umbra and Gubbio. In 1231 he became cardinal protodeacon.
In 1234 the new pope Gregory IX named Capocci rector of Tuscia (Tuscany), as well as capitano (commander) of the Papal troops. In the same year Luca Savelli, grandson of Honorius III, forced the pope to flee from Rome to Umbria. Emperor (and King of Naples and Sicily) Frederick II moved from southern Italy with an army to help Gregory, joining Capocci's troops at Montefiascone. Savelli's army was besieged in a fortress a few kilometers south of Viterbo and, although Frederick left the siege in advance, Capocci was able to defeat them. Frederick's ambiguous behaviour led to his excommunication by Gregory four years later, and Capocci defended the pope's move with a series of letters and treatises disseminated throughout Europe, including the manifesto Ascendit de mare.