Answer
The last monarch of the Iberian Union was Philip III of Spain. He was also the King of Naples, Sicily, Portugal and the Algarves. The union of the two kingdoms under the Spanish Habsburgs lasted from 1580 to 1640. However, the Portuguese nobility felt excluded from positions of power and resented Castilian control, which led to a revolt that placed John IV on the throne and restored Portuguese independence.