The 11th century saw the Investiture controversy between Emperor and Pope over the right to make church appointments, the first major phase of the struggle between Church and state in medieval Europe. The Papacy were the initial victors, but as Italians divided between Guelphs and Ghibellines in factions that were often passed down through families or states until the end of the Middle Ages, the dispute gradually weakened the Papacy, not least by drawing it into politics. The Church also attempted to control, or exact a price for, most marriages among the great by prohibiting, in 1059, marriages involving consanguinity (blood kin) and affinity (kin by marriage) to the seventh degree of relationship.