These gates (St George’s, Chania, New and Jesus’ gates) were locked at sunset, and for those outside the city’s walls at this time, a night had to be spent in a hostel. The fortifications, originally triangular in shape became trapezoid with additions to the side facing the sea. In 1303 an earthquake severely damaged the castle’s walls, and it had to be rebuilt. In 1523, the fortress called ‘la rocca al mare’ (or the fortress of the sea) was built, due to the increasing threat of piratical raids. This fortress still stands today. The sheer walls were replaced with canon-proof ones, angled at an incline of 20 degrees, allowing canon balls to deflect, rather than crash through the walls. The cities fortifications withstood 21 years of battering by the Turks, between 1648 and 1669 (the longest siege in European history), before the Venetians surrendered the city to the Ottoman Empire. A whole generation had grown-up with the city’s walls during that time. The loss of life on the Ottoman side has been put at 137, 116, by a contemporary Turkish source. The Greeks and Venetians within, were allowed to leave the island, and Venice was allowed by treaty, to hold on to three fortified islets (Gramvoussa, Souda, and Spinalonga), which remained in their hands until the Turks reneged on the deal in 1715.