The Protectorate of the Marches was a peculiar state in early modern Europe, which existed twice, in 1472-1522 and 1565-1631.
Originally just a part of the Papal States, after the infamous Sacco di Roma in 1466 by the Rum-Seljuks, who occupied all of Latium, the Marches came under the protection of Castille-Portugal. Theoretically still under the Pope, de facto the country was governed by the Duke of Alba (from Castille). Although no one said it loud, the Pope and the other church leaders were quite content in Avignon and didn't care that much about Rome any more.
1516-18, the Seljuks invaded Florence. Although they stayed supreme in open battle, they didn't manage to take the new "Italian fortresses" (again). When the Janissaries became discontent because they couldn't plunder the cities, the Sultan had to cancel the attack, directed it into the Marches instead. The tiny republic of San Marino was overrun by them as well. During 1519-22, the alliance of the Quadruple Monarchy, Florence, Venice and some German princes fought the Seljuks to a stalemate along the Po river, which became the new northern border of the Seljuk empire. The northern parts of the former Papal States were annexed by Venice.
Under Seljuk rule
In 1542, a great uprising of the Carbonari happened in South Italy, which soon spread to Rome itself, and the Marches too. Florence used the opportunity and invaded Latium. Many Christian volunteers went to Italy to fight against the Seljuks; some pious nobles, mainly from Castille-Portugal, supported Florence with money. 1543, Florentine troops stood in the county of Naples and the Marches. Now however, the main army of the Seljuks arrived, and the Florentine army was defeated several times. In 1544, peace had to be made.
1556, the Triple Monarchy of England-Castille-Portugal declared war on the Seljuks, enraged over the fate of Rome. Savoy and Florence joined the war. In 1559, Rome was reconquered by the Christians; all the Muslims found there were massacred. The so-called second Occidental-Seljuk War ended in 1565 with the Peace of Ostia, the Seljuks gave up Latium (to Florence, which would "administer", de facto annex it) and the Marches, Algiers, Tunis and Sicily (which went to the Triple Monarchy). The Romans displaced ~20 years ago returned in triumph. The victorious Italians demanded that the Pope returns to Rome, which the French king denied. The Marches were returned to their protectorate status.
Despite being under Christian rule now, the Italians didn't like the new government very much, and some of them started to look over the border to Florence, which had survived two Seljuk occupations. At the beginning, the dukes and grand dukes of Florence didn't want trouble with the Quadruple and later Triple Monarchy; but after it fell apart, in 1631 the Florentines finally parted with them, and annexed the Marches. They made a compromise with France: While the former Papal States were still nominally under the Pope, Florence would "administer" them for him. This was also seen as a compensation for the Pope staying in Avignon, while many Italians still wished for his return to Rome. In addition, Florence had to allow France's ally Venice to annex the more valuable North: Bologna, Ferrara and Ravenna.