With the death of his wife, Isabella I, in 1504, Ferdinand had to yield the government of Castile to his son-in-law Philip of Burgundy, who assumed power in the name of his wife Joanna, Isabella's heiress. Ferdinand objected to Philip's policies, and to prevent Philip from gaining Aragon through Joanna, he sought to have a male heir with a new wife. A new male heir would displace Joanna (and by extension her husband) from the line of succession. He negotiated with King Louis XII of France for a marriage, hoping to gain accession to the throne of Navarre. In the Treaty of Blois (1505), Louis agreed to have Germaine of Foix marry Ferdinand; Germaine was Louis' niece (daughter of his sister) and Ferdinand's grandniece (granddaughter of his half-sister). Louis XII also ceded his weak claims to the Kingdom of Naples (already controlled by Aragon) and the Kingdom of Jerusalem (controlled by neither) to his niece, conditional on a male child being produced. The marriage, between Ferdinand (aged 54) and Germaine (aged 18), took place in March 1506. A short truce and brief alliance between the two kings resulted, despite several wars before and after the Treaty.