The free commune of Parma had been a longtime supporter of the Ghibelline party. However, it was also considered an important stronghold to take by the Guelphs, due to its flourishing economy and its position across the Via Francigena. On 25 June 1243 Innocent IV, who had several friends in the city and had held several positions in the local diocese, was elected as pope. He thus started a plan to bring Parma to the Guelph side, by replacing the current bishop with Alberto Sanvitale, who was more loyal to him, and order the local Franciscans to convince the population to change side. The already strained relationship between Emperor Frederick II and the pope worsened: the situation was further aggravated by the coup by which the city fell in the hands of a Guelph group, including Ugo Sanvitale and Bernardo di Rolando Rossi. The emperor knew of the rebellion when he was at Pavia. He immediately mustered an army, marched against Parma from Emilia, ousted Rolando Rossi, and installed Tebaldo Franceschi as the new city's captain. Innocent IV, however, continued his hate campaign against Frederick both in Lombardy and the Kingdom of Sicily with letters to the local nobility and clergymen. Several noblemen, including the Sanseverino and three Fasanella, set a plot against the emperor in 1244: however, they were betrayed by a participant, and many were arrested and executed. Some conspirators sought the protection of the pope, who, in the meantime, had moved to Lyon, which was more distant from the imperial armies. Here he summoned the Council of Lyon in 1245, where it was decided to confirm the excommunication of the emperor, proclaimed in 1227 by Gregory IX.
Battle
Now that the papal participation in the plot against him had become clear, Frederick wrote to the noblemen to inform them of the pope's vile behavior, and marched with an army to Lyon in 1247. Once he had arrived in Turin, however, he received news that Parma had rebelled again. According to Salimbene di Adam, a group of Guelph Parmigian refugees who had taken shelter in Piacenza led by Ugo di Sanvitale and Bernardo di Rolando Rossi. They defeated the imperial garrison under the imperial podestà Enrico Testa near Borghetto di Taro and occupied the city with no resistance, since the garrison of Enzio of Sardinia, Frederick's son, was besieging Quinzano. Frederick immediately diverted his troops to Emilia, and at the same time he called for reinforcements from friendly lords and communes. The imperial army was also joined by Enzio, who raised the siege of Quinzano, and by a Cremonese contingent led by Ezzelino III da Romano, as well as by soldiers from Padua, Verona, and Vicenza. The pope did his best to send help to Parma from cities faithful to him, such as Milan, Piacenza, Mantua, and Ferrara. Gregorio di Montelongo was able to reach the city, organizing its defense with Bernardo Rossi and Gilberto da Gente. Perhaps due to a shortage of siege weapons, Frederick decided to take the city by starvation. The Guelphs were however determined to resist thanks to the papal help, and the siege dragged on for eight months. Frederick ordered the construction of an entrenched camp near Grola, calling it Victoria, including houses, palaces, and a church, declaring that it would become the seat of his kingdom after the fall of Parma. However, several noblemen abandoned him. Further, on 12 February 1248 Gregorio di Montelongo launched a sortie: after the sufferings they had faced during the siege, the people in arms followed the image of the Holy Virgin and attacked, Frederick was hunting in the Taro valley, and Vittoria was destroyed. He took refuge at Borgo San Donnino, and then moved to Cremona.
Aftermath
The defeat at Parma was a decisive defeat for Frederick, who had to abandon forever any dream to conquer northern Italy. The Second Lombard League recovered some territories, the whole Emilia and Romagna embraced the Guelph cause, while the Marquisate of Montferrat and the Republic of Genoa remained hostile to him. Ezzelino III, despite remaining in the Ghibelline side, ousted the imperial governor from Monselice. According to anti-imperial Franciscan chronicler Salimbene di Adam, "Parma fuit causa totius ruine". Since then, the town's motto id "Hostis turbetur quia Parmam Virgo tuetur".