Not until 1249 did King Afonso III (1248-1279) complete the Reconquest and secure borders for Portugal 250 years before the Spanish could do the same.
It was King Afonso the third that defended Portugals borders from Spain.