The Ottomans lost the Battle of Lepanto in 1571 by Philip II of Spain and his Holy League. The Ottomans quickly recovered by capturing Cyprus from the Republic of Venice. However, the defeat shattered the myth of Ottoman invincibility. The Ottomans suffered many defeats in the next 30 years: the Long War with the Austrian Empire ended in stalemate, and the Safavids invaded the eastern Ottoman provinces. Murad IV recaptured Iraq and the Caucasus from Persia. The "Sultanate of Women" became an nickname for the Ottoman Empire after consorts Kösem Sultan and Turhan Sultan became important in the empire and sometimes made even economic decisions in the Sultan's place. The Grand Vizier also took a greater role under the leadership of the Köprülüs. Crete was captured from Venice and southern Ukraine was captured from Poland.