John IV, nicknamed John the Restorer, was the King of Portugal whose reign, lasting from 1640 until his death, began the Portuguese restoration of independence from Habsburg Spanish rule.