During the 16th and 17th centuries, horses moved continually between Spain and Portugal, and horses from the studs of Andalusia were used to improve the Portuguese cavalry. Portugal's successful restoration war against Spain (1640–1668) was in part based on mounted troops riding war horses of Spanish blood. During the reign of Philip III of Portugal (also Philip IV of Spain), Portuguese horse breeding reached its lowest point. The Spanish passed laws to halt the country's production of cavalry horses, and what stud farms did exist were run in secrecy with horses smuggled or stolen from Spain. These secret farms, however, provided the base for the modern Lusitano. In 1662, when Charles II of England married Catherine of Braganza of Portugal, the royal dowry included Portugal's Tangier and Bombay garrisons. These garrisons included large groups of Portuguese cavalry, mounted on Iberian horses.