The fort at Imeri Gramvousa was built between 1579 and 1584 during Venetian rule over Crete to defend the island from the Ottoman Turks. The fort remained in Venetian hands throughout the prolonged Cretan War, and in the treaty of 16 September 1669, which surrendered Crete to the Ottomans, Gramvousa, along with the fortresses of Souda and Spinalonga, was retained by Venice. These three forts defended Venetian trade routes and were also strategic bases in the event of a new Ottoman–Venetian war for Crete.
On 6 December 1691, during the Morean War (another Ottoman–Venetian war), the Neapolitan Captain de la Giocca betrayed the Venetians by surrendering Gramvousa to the Ottoman Turks for a generous bribe. He lived the rest of his life in Constantinople and was well known by the nickname "Captain Grambousas". Not long after the start of Turkish rule, Cretan insurgents used to gather at the three coastal forts which included Gramvousa.
Source: wikipedia.org