The Treaty of Villafáfila is a treaty signed by Ferdinand the Catholic in Villafáfila on 27 June 1506 and by Philip the Handsome in Benavente, Zamora, on 28 June.
The treaty recognised the incapacity of Ferdinand's daughter and Philip's wife, Joanna the Mad, to reign on her own as Queen of Castile. Joanna had succeeded her mother, Isabella the Catholic, who had appointed her husband and co-ruler Ferdinand as regent of Castile in the name of their mentally unstable daughter. However, Philip demanded his share in the government. The Treaty of Villafáfila followed the Treaty of Salamanca (24 November 1505), in which Ferdinand and Philip were recognised as co-regents in Joanna's name. However, the new treaty required Ferdinand to cede all power to Philip and retire to his own hereditary realms, the Crown of Aragon, to which Joanna was also heir presumptive, and proclaimed Philip jure uxoris King of Castile. Ferdinand renounced not only the government of Castile, but also the lordship of the Indies, leaving a half of the income of the kingdoms of the Indies. Joanna and Philip immediately added to their titles of "Kings of Indies, Islands and Mainland of the Ocean Sea".
The treaty was made moot very soon, since King Philip I died on 25 September. This left Ferdinand free to assume the government of Castile, and again return to the regency of the crown and recover the title of lordship of the Indies, both of which he held until his death in 1516.
The Indies remained in an ambiguous state from the death of Philip in 1506 to the death of Ferdinand in 1516, being half a personal property of the kings (a "lordship" with absolute power for its lord), and half a kingdom of the Crown (ruled under the laws of the Crown of Castile). From 1516 to 1520 the Indies were extraofficially part of the Crown of Castile. In July 9, 1520 Charles V, Holy Roman Emperor incorporated them explicitly into the Crown of Castile and he forbid any future separation.