Although a small island, Kastellorizo or Megisti has a long history, having been inhabited since the Neolithic era, and then colonized by the Dorians, like all the Dodecanese.
It received the name Kastellorizo around the end of the 14th century, from the Knights of St. John, on the 8th Master of the Order, when they built a castle under which the city developed on the reddish rock near the entrance of the port.
The first inhabitants of Megisti, who took part in the campaign of Troy along with the other Dodecanese were the Dorians who had lived in Rhodes and with which they had political and administrative ties. The island was ruled by virtuous Rhodian commanders.
After the death of Alexander the Great, all the Aegean islands came under the jurisdiction of Ptolemy I and then were occupied by the Romans. Megisti gained partial autonomy, which was abolished in 38 BC. by Emperor Vespasian and after the division of the Roman state. Then, it was ruled by the Byzantine Empire.
During Byzantine times, the island was included in the "Theme of the Cypriots", as well as Rhodes. In 1306 it was occupied by the Knights of St. John of Rhodes.
The island was consequently conquered by the Egyptians, the Franks, and the Turks from 1440 to 1522.
Kastellorizo was assigned to Greece with the Paris Peace Treaties, in 1947. In May 1945, it was still under British administration, but on September 15, 1947 effectively came under Greek administration.