after losing to the league's forces at the battle of agnadello, venice found its holdings in italy shrinking drastically. soon padua, venice's most strategically vital "terraferma" holding, had fallen, and venice itself was threatened. loredan united the population, calling for sacrifice and total mobilisation. padua was retaken, though venice was still forced to accept a reluctant peace, following which it joined the pope as only a junior ally in his new war against the french. the alliance was on the verge of victory, but a dispute arose over territory. emperor maximilian refused to surrender any imperial territory, which in his eyes included most of the veneto, to the republic; to this end, he signed an agreement with the pope to exclude venice entirely from the final partition. when the republic objected, julius threatened to reform the league of cambrai. in response, venice turned to louis; on 23 march 1513, a treaty pledging to divide all of northern italy between france and the republic was signed at blois. under this alliance with the french king louis xii, the venetians achieved a decisive victory over the papal states, and were able to secure back all the territories they had lost. in addition, the papacy was forced to repay many outstanding debts to the loredan family totaling approximately 500,000 ducats, an enormous sum of money.