which they had ruled as a fief, and was well on his way towards establishing a permanent Borgia state in the region when Alexander died on 18 August 1503. Although Cesare managed to seize the remnants of the Papal treasury for his own use, he was unable to secure Rome itself, as French and Spanish armies converged on the city in an attempt to influence the Papal conclave; the election of Pius III (who soon died, to be replaced by Julius II) stripped Cesare of his titles and relegated him to commanding a company of men-at-arms. Sensing Cesare's weakness, the dispossessed lords of the Romagna offered to submit to the Republic of Venice in exchange for aid in regaining their dominions; the Venetian Senate accepted and had taken possession of Rimini, Faenza, and a number of other cities by the end of 1503. Julius II, having secured his own control of the Papal armies by arresting and imprisoning Cesare, first in Bologna and later in Ravenna, quickly moved to re-establish Papal control over the Romagna by demanding that Venice return the cities she had seized. The Republic of Venice, although willing to acknowledge Papal sovereignty over these port cities along the Adriatic coast and willing to pay Julius II an annual tribute, refused to surrender the cities themselves. In response, Julius concluded an alliance with France and the Holy Roman Empire against Venice; the death of Isabella I of Castile (26 November 1504) and the resulting collapse of relations between the parties soon dissolved the alliance (the Treaty of Blois (1504), which had ended the Italian Wars of 1499–1504, became a 'dead letter'), but not before Venice had been induced to abandon several of the cities, except for the three key towns of Rimini, Faenza and Cervia. Julius, although unsatisfied with his gains, did not himself possess sufficient forces to fight the Republic; for the next two years he instead occupied himself with the reconquest of Bologna and Perugia, which, located between Papal and Venetian territory, had in the meantime assumed a status of quasi-independence. In 1507, Julius returned to the question of the cities in Venetian hands; once again rebuffed by the Senate, he encouraged Emperor Maximilian I to attack the Republic. Maximilian, using his journey to Rome for the Imperial coronation as a pretext, entered Venetian territory with a large army in February 1508 and advanced on Vicenza,