In 1297 King Dinis of Portugal took personal interest in exports and in 1317 he made an agreement with Genoese merchant sailor Manuel Pessanha (Pessagno), appointing him first admiral of the Portuguese navy, with the goal of defending the country against Muslim pirate raids. Outbreaks of bubonic plague led to severe depopulation in the second half of the 14th century: only the sea offered alternatives, with most population settling in fishing and trading coastal areas. Between 1325 and 1357 Afonso IV of Portugal encouraged maritime commerce and ordered the first explorations. The Canary Islands, already known to the Genoese, were claimed as officially discovered under patronage of the Portuguese but in 1344 Castile disputed them, expanding their rivalry into the sea.