The army of Juan I of Castile invaded Portugal in 1383 , but Joao of Avis , recently proclaimed King Joao I of Portugal , defeated the Spaniards in a decisive battle which was fought in 1385 at Aljubarrota , about 100km ( 62 miles ) north of Lisbon .
Joao of Avis was never crowned as royalty .