In 1209 there were in Lerici two councils for a final resolution of the rivalry with Genoa. A twenty-year peace treaty was signed. But when in 1220 the emperor Frederick II confirmed his supremacy over the Tyrrhenian coast from Civitavecchia to Portovenere, the Genoese and Tuscan resentment against Pisa grew again. In the following years Pisa clashed with Lucca in Garfagnana and was defeated by the Florentines at Castel del Bosco. The strong Ghibelline position of Pisa brought this town diametrically against the Pope, who was in a strong dispute with the Empire. And indeed the pope tried to deprive the town of its dominions in northern Sardinia.
In 1238 Pope Gregory IX formed an alliance between Genoa and Venice against the empire, and consequently against Pisa too. One year later he excommunicated Frederick II and called for an anti-Empire council to be held in Rome in 1241. On 3 May 1241, a combined fleet of Pisan and Sicilian ships, led by the Emperor's son Enzo, attacked a Genoese convoy carrying prelates from Northern Italy and France, next to the Isola del Giglio, in front of Tuscany: the Genoese lost 25 ships, while about thousand sailors, two cardinals and one bishop were taken prisoner. After this outstanding victory the council in Rome failed, but Pisa was excommunicated. This extreme measure was only removed in 1257. Anyway, the Tuscan city tried to take advantage of the favourable situation to conquer the Corsican city of Aleria and even lay siege to Genoa itself in 1243.
The Ligurian republic of Genoa, however, recovered fast from this blow and won back Lerici, conquered by the Pisans some years earlier, in 1256.
The great expansion in the Mediterranean and the prominence of the merchant class urged a modification in the city's institutes. The system with consuls was abandoned and in 1230 the new city rulers named a Capitano del Popolo ("People's Chieftain") as civil and military leader. In spite of these reforms, the conquered lands and the city itself were harassed by the rivalry between the two families of Della Gherardesca and Visconti. In 1237 the archbishop and the Emperor Frederick II intervened to reconcile the two rivals, but the strains did not cease. In 1254 the people rebelled and imposed twelve Anziani del Popolo ("People's Elders") as their political representatives in the Commune. They also supplemented the legislative councils, formed of noblemen, with new People's Councils, composed by the main guilds and by the chiefs of the People's Companies. These had the power to ratify the laws of the Major General Council and the Senate.