Mythology connects Anafi with the return of the Argonauts from Colchis. Trying to avoid the sudden darkness and severe bad weather in the Cretan sea, the Argonauts sought the help of the god Apollo. And he threw a bright beam of light, which showed them the nearest island, on which they hastened to anchor. Because of the salutary appearance of this island, the Argonauts named it Anafi (=illuminated island) and, to honor the god who supported them, they built there a sanctuary of Apollo Aiglitos (=radiant).
The attempt to connect Apollo with the history of the island is due to the prominent position of this particular god in the mythology of the Cyclades. Every year they honored the god with a festival called "Hyacinthia". Other sources claim that the island was the home of Aeolus, the god of the winds, who offered Odysseus the sacks of winds.
According to archaeological finds that have been discovered in Anafi, it is proven that the island was inhabited since prehistoric times. After the decline of the Cycladic civilization, Anafi was inhabited by Phoenicians and Dorians, who founded the city of Anafi. In the 5th century BC, Anafi became a member of the Athenian Alliance. At the top of Kasteli hill, in the center of the island, the remains of its ancient capital (4th-2nd century BC) are preserved. The finds mainly include traces of a strong wall, a cemetery with impressive tombs in the form of houses, but also Roman tombstones.
The ancient temple of Apollo of Asgelata or Aigletos, which according to the mythological tradition was built by the Argonauts, was located on the southeast coast, and on its ruins is built the Monastery of Kato Panagia of Kalamiotissa, using ancient building materials and inscriptions. The temple was the focus of the religious life of the ancient inhabitants. Inscriptions show that other gods were also worshipped, such as Asclepius, Zeus Ctesius and Aphrodite. The political center (Kastelli) and the religious center (the temple of Apollo) were connected by a sacred road, parts of which have been identified. Finally, the location Katalymatso (or Katalyzakia), a little west of the sanctuary, is identified with the ancient port of the island, as can be seen from the ruins of shipyards and a small settlement, which was connected to the above two locations, through a bypass of the sacred road.
In the Byzantine era, Anafi did not develop much activity. After the capture of Constantinople by the Franks (1204), Markos Sanoudos formed the Duchy of the Aegean, after conquering all of the Cyclades. Anafi was given to Leonardo Foscolos and her name Latinized to Namphio.
In the Middle Ages the island belonged to the Duchy of Naxos and was ruled by various Venetian rulers. Anafi, like the other islands of the Cyclades, suffered from many piracy which caused great destruction. Many residents of the island were forced to flee to Crete. The worst disaster came in 1537, when the island was sacked by Barbarossa and then enslaved by the Turks.
Anafi actively participated in the revolution of 1821 while it was integrated into the Greek state in 1832. During the reign of Otto, because the Anafiites had the reputation of being the best builders of the country, by order of the king several residents moved from the island to Athens, for to build the royal palaces. They settled at the foot of the Acropolis and created their own neighborhood, "Anafiotika", which was a miniature of their island which is now an admirable architectural gem of Athens.