 However, the Castilians saw the elder Ferdinand as a potential rival and threat to Berengaria's son.The marriage of Ferdinand's parents was annulled by order of Pope Innocent III in 1204, due to consanguinity, but the legitimacy of the children was recognized.Berengaria then took their children, including Ferdinand, to the court of her father, King Alfonso VIII of Castile.