Answer
The Portuguese Restoration War began during John IV's reign, resulting in Portugal regaining its independence from Spanish rule. This conflict arose from Spain's claim to the Portuguese throne following the death of King Sebastian in 1578. Portugal faced several years of Spanish control until successful rebellion efforts led by John IV restored Portuguese sovereignty in 1640.