After the disastrous defeat of Pope Alexander III at the Battle of Monte Porzio in May 1167 against Imperial forces, only the Lombard League remained as the last legitimate fighting force opposing the Emperor and was therefore heavily backed by the Pope.
Kenneth Pennington wrote: "Alexander’s inability to control Rome and the Papal States was due to his conflict with Frederick. Although he attempted to support the cities of Lombardy, he had neither the power nor the resources to render effective assistance."
The Milanese were informed about Frederick's plan and prepared for battle. A Carroccio, or a sacred war wagon drawn by oxen, was build, it was decorated with the city standard and an altar upon which the cross of Archbishop Aribert of Milan was erected. In 1038, Archbishop Aribert led the victorious defence of Milan against the Holy Roman Emperor Conrad II, and therefore his cross was a symbol of victory against the Empire. According to Sire Raoul, a chronist from Milan, 900 knights came from Milan and around 550 knights from three other towns, the rest of the League's forces were foot soldiers. The "Company of Death" was a foot soldier unit, that according to Milanese chronicles was led by Alberto da Giussano, and formed the core of the Lombard infantry.
While Frederick and his reinforcements were on their way back to Pavia to join the main Imperial force, the Lombard League placed about 3,500 men near the west bank of the Olona. The infantry with the Milanese war cart, the carroccio, stood in a hastily fortified position at Borsano. The Lombards knew that Frederick was about to skirt through their area, however, the Lombards did not know how close Frederick already was. At dawn on the 29 May, the Lombard League sent a reconnaissance unit of 700 horsemen to the Seprio landscape. At the same time, the emperor had crossed the Olona and was marching south from Cairate, five miles northeast of Busto Arsizio. Here, the battle commenced. The Lombard reconnaissance and the 300 Imperial vanguard clashed. The clash was brief and bloody and with Frederick already on the horizon, the Lombard reconnaissance broke off and fled beyond Borsano. Now, Frederick and his Imperial German army launched a rampant and brutal attack on the Lombard League forces near Borsano - Legnano. The Lombard cavalry was largely routed but managed to escape the skirmish, leaving the infantry and carroccio on its own. Frederick advanced to the Carroccio, and assaulted the infantry and the Company of Death with his cavalry.
M.B. Synge wrote this about the Company of Death: "Nine hundred desperate patriots forming the Company of Death defended the sacred car. Seeing the Germans were gaining ground, fearful for the safety of their treasure, they suddenly knelt down and renewed their vow to God that they would perish for their country "
The infantry positioned itself in a phalanx-like line. The Fight around the Carroccio was a long and bloody fight in which the Lombard League infantry brought the Imperial army to a stalemate. Despite the difficulties the Imperial cavalry had against the Lombard infantry, it would have still prevailed in the long run. Finally, the Lombard League forces received help from its regrouped cavalry and from a Brescian cavalry that was called to aid by the fleeing reconnaissance troops. The regrouped reconnaissance troops and the Brescian cavalry jointly attacked Frederick's army from the rear. The decisive assault was made by the Brescians, who managed to break through the lines and attack Frederick directly. In this attack, his guards and standard-bearer were killed, and Frederick was thrown off his horse and believed to be dead. Upon this, the Imperial troops panicked and fled, pursued to the Ticino by the Leagues cavalry. The generals tried to rally the men in vain. The booty and prisoners taken by the League were immense.
After the battle, Frederick's rule over Lombardy was decisively broken. The knights that managed to escape, gathered in Pavia. There, they brought the news of Frederick's presumed death to his wife Beatrice I, Countess of Burgundy. Beatrice and the Empire mourned Frederick's demise but after several days the Emperor appeared at the gates of Pavia.
H. E. Marshall wrote: " Then, greatly to the joy of all, after three days Barbarossa suddenly appeared before the gates of Pavia. Although wounded and bruised and left for dead Frederick had not been killed. "
The victory of the Lombard League forced Frederick to travel to Venice. In the Peace of Venice, 1177, Frederick and Pope Alexander III reconciled. The Emperor acknowledged the Pope's sovereignty over the Papal States, and in return Alexander acknowledged the Emperor's overlordship of the Imperial Church. The Peace of Venice were heavily instigated by Archbishop Wichmann of Magdeburg, who was amongst the defeated at Legnano. The cities of Lombardy, however, continued to fight until 1183, when, in the Peace of Constance, Frederick conceded their right to freely elect town magistrates. The Treaty was cast in bronze.
Frederick did not forgive Henry the Lion for refusing to come to his aid in 1176. Taking advantage of the hostility of other German princes to Henry, Frederick had Henry tried in absentia by a court of bishops and princes in 1180, declared that Imperial law overruled traditional German law, and had Henry stripped of his lands and declared an outlaw.
On 27 January 1186, Frederick's son Henry VI married Constance of Sicily in Milan as a sign that peace had really been established.