Heraklion is the birthplace of the Minoan civilization, the first European civilization, which appeared around 3000 BC.
After the fall of the Minoans, Heraklion, as well as the rest of Crete island, fared poorly. When the Romans arrived, some construction in the area began. During the early Byzantine times the area was teeming with pirates.
The present city of Heraklion was founded in 824 by the Arabs who had taken over the island from the Eastern Roman Empire. They built a moat around the city to protect it, naming the city "Castle of the Moat".
Byzantine forces attacked the city in 960, burning it down after its surrender in March 961. Soon it was rebuilt and renamed Chandax, remaining under Byzantine control for the next 243 years.
Chandax was bought by the Republic of Venice in 1204 as part of a complicated political deal. The Venetians built enormous fortifications, most of which still exist, and a fortress in the harbour. Chandax was renamed Candia and became the seat of the Duke of Candia, and the Venetian administrative district of Crete became Kingdom of Candia. In 1212, to secure their rule, Venetians began to resettle families from Venice on Crete. The two different cultures and the influence of the Italian Renaissance led to the Cretan Renaissance.
During the Cretan War in 1645-69, the Ottomans besieged the city for 21 years, the longest siege in history. In 1669, the Ottoman army conquered the city. Under the Ottomans, the city was named Kandiye, but was informally known in Greek as Megalo Castro (Big Castle).
The autonomous Cretan State was created in 1898. During the period of direct occupation of Crete by the Great Powers, Candia was part of the British zone. At this time, the city was renamed Heraklion.
In 1913 Heraklion with the rest of Crete was incorporated into the Kingdom of Greece. In 1971 Heraklion became again capital of Crete, replacing Chania.