In the early modern period, the Republic's military strength was well out of proportion with its demographic weight. In the late 16th century, it ruled over a population of about 2 million people throughout its empire. In 1571, while preparing for war against the Ottomans, the Republic had 37,000 soldiers and 140 galleys (manned by tens of thousands of sailors and oarsmen), excluding urban militias. The Venetian peacetime army strength of 9,000 was able to quadruple in the course of a few months by drawing upon professional hired soldiers and territorial militias simultaneously. These troops generally showed marked technical superiority over their primarily Turkish opponents, as demonstrated in battles such as the 18-month Siege of Famagusta, in which the Venetians inflicted outsized casualties and only were defeated when they exhausted their gunpowder. Like other states of the period, the Republic's military strength peaked during wars, only to quickly go back to peacetime levels due to costs. The level of garrisons stabilized after 1577 at 9,000, with 7,000 infantry and the rest cavalry. In 1581 there were 146 galleys and 18 galleasses in the navy, requiring a third of the Republic's revenue. During the Cretan War (1645-1669), the Republic fought mostly alone against the undivided attention of the Ottoman Empire, and though it lost, managed to keep fighting after losing 62,000 troops in the attrition, while inflicting about 240,000 losses on the Ottoman army and sinking hundreds of Ottoman ships. The cost of the war was ruinous, but the Republic was eventually able to cover it. The Morean War further confirmed the Republic's position as a military power well into the late 17th century.