The history of Thessaly covers the history of the region of Thessaly in north-central Greece from antiquity to the present day.

Topography Thessaly is characterized by the large Thessalian plain, formed by the Pineios River, which is surrounded by mountains, most notably the Pindus mountain range to the west, which separates Thessaly from Epirus. Only two passes, the Porta pass and, in the summer, the pass of Metsovo, connect the two regions. From the south, the narrow coastal pass of Thermopylae connects Thessaly with southern Greece. In the north Thessaly borders on Macedonia, either through the coast or the pass of Servia towards Thessalonica, or in the northwest towards western Macedonia.

Antiquity

The first evidence of human habitation in Thessaly dates to the late Paleolithic, but in the early Neolithic this expanded rapidly. Over 400 archaeological sites dating to the period are known, including fortified ones. The most notable of these is at Sesklo. During the Mycenaean period, the main settlement was at Iolcos, as attested in the later legends of Jason and the Argonauts.

Archaic period

A distinct Thessalian tribal identity and culture first began to form from the 9th century BC on as a mixture of the local population and immigrants from Epirus, first in the region of the Pelasgiotis, with Pherae as its main centre. From there they quickly expanded inland to the plain of the Pineios and towards the Malian Gulf. The Thessalians spoke a distinct form of Aeolic Greek. In the late 7th century BC, the Thessalians conquered the so-called perioikoi. In this process the Thessalians captured Anthela and came to control the local amphictyony. By assuming the former share of the perioikoi in the Delphic Amphictyony, the Thessalians also came to play a leading role in the latter, providing 14 of the 24 hieromnemones and presiding over the Pythian Games. As a result of the First Sacred War (595–585 BC), the Thessalians briefly extended their sway over Phocis as well, but the Boeotians drove them back after the battles of Hyampolis and Ceressus in the mid-6th century.

In the second half of the 7th century, Thessaly became the home of large aristocratic families, controlling huge tracts of land and working them with serfs (penestae), which became a characteristic of Thessaly. The most important were the Aleuadae of Larissa, the Echecratidae of Pharsalus, and the Scopadae of Crannon. Their clan chiefs were often called basileis ("kings"). It was Aleuas Pyrrhos ("the Red") who cemented the aristocracy's predominance by reforming the Thessalian League on the basis of the "tetrads" (quadripartite division), linking it with the noble-controlled kleroi ("land lots") obliged to supply 40 horsemen and 80 infantrymen each. Traditionally, the office of tagus has been regarded as the senior magistrate of the Thessalian League; more recent studies however regard the tagus as a purely local official, and suggest the tetrarches as the head of the League.

Classical period

In the summer of 480 BC, the Persians invaded Thessaly. The Greek army that guarded the Vale of Tempe evacuated the road before the enemy arrived. Not much later, Thessaly surrendered. The Thessalian family of Aleuadae joined the Persians. In the Peloponnesian War the Thessalians tended to side with Athens and usually prevented Spartan troops from crossing through their territory with the exception of the army of Brasidas. In the 4th century BC Thessaly became dependent on Macedon. In the 2nd century BC, as with the rest of Greece, Thessaly came under the control of the Roman Republic.

Roman period From 27 BC it formed part of the Roman province of Achaea, with capital at Corinth. In the reign of Emperor Antoninus Pius (), Thessaly was separated from Achaea and given to the province of Macedonia; eventually it became a separate province. In the new administrative system as it evolved under Diocletian () and his successors, Thessaly was a separate province within the Diocese of Macedonia, in the praetorian prefecture of Illyricum. With the division of the Roman Empire in 395, Thessaly remained as a part of the East Roman (Byzantine) Empire.

Being far from the Empire's frontiers, and of little strategic importance, Greece lacked any serious fortifications or permanently stationed garrisons, a situation that lasted until the 6th century and led to much devastation by barbarian raids. Thus in 395–397, as most of Greece, Thessaly was occupied by the Visigoths under Alaric, until they were driven out by Stilicho. The Vandals under Geiseric raided the coasts of Greece in the period 466–475, and in 473 the Ostrogoths under Theodemir advanced into Thessaly and captured Larissa before Emperor Leo I gave in and allowed him and his people to settle in Macedonia. Under Theodemir's son, Theodoric the Great, the Ostrogoths once more invaded Thessaly in 482, until they left for Italy in 488. According to the Synecdemus, in the 6th century the province included 16 cities along the capital, Larissa: Demetrias, Phthiotic Thebes, Echinos, Lamia, Hypata, Metropolis, Trikke, Gomphoi, Caesarea, Diocletianopolis, Pharsalus, Saltos Bouramesios, Saltos Iovios, and the islands of Skiathos, Skopelos and Peparisthos.

From the reign of Justin I () on, attacks on the imperial frontier on the Danube became more and more frequent, and the Balkan provinces were heavily raided, although Greece was less affected. In 539, however, a large Hunnic raid plundered Thessaly and, bypassing the fortified Thermopylae pass, devastated Central Greece. This led to a serious fortification effort under Justinian I (), and the establishment of a permanent garrison at Thermopylae. The area was once more invaded in 558 by the Kotrigurs, but they were stopped at the Thermopylae. Despite the devastation caused by these raids, in Thessaly, and southern Greece in general, the imperial administration seems to have continued to function, and traditional public life to have continued, for much of the century, possibly up to the end of the reign of Justin II (). Nevertheless, the barbarian raids, the two great earthquakes of 522 and 552, and the arrival of the Plague of Justinian in 541–544, led to a drop in population.

Middle Ages Slavic invasions and restoration of Byzantine control The late antique order on Greece was irrevocably shattered with the Slavic incursions that began after 578. The first large-scale raid was in 581, and the Slavs appear to have remained in Greece until 584. Byzantium, confronted by long and bloody wars with Sassanid Persia in the east, and with the Avar Khaganate in the north, was largely unable to stop these raids. After the murder of Emperor Maurice in 602 and the outbreak of the great Byzantine–Sasanian War of 602–628, the Danube frontier, somewhat stabilized under Maurice, collapsed entirely, leaving the Balkans defenceless for the Slavs to raid and settle. The Slavic settlement that followed the raids in the late 6th and early 7th centuries affected the Peloponnese in the south and Macedonia in the north far more than Thessaly or Central Greece, with the fortified towns largely remaining in the hands of the native Greek population. Nevertheless, in the first decades of the 7th century the Slavs were free to raid Thessaly and further south relatively unhindered; according to the Miracles of Saint Demetrius, in the Slavic tribes even built monoxyla and raided the coasts of Thessaly and many Aegean islands, depopulating many of them. Five of Thessaly's cities disappear from the sources during the 7th century, and Slavs settled in the northern and northeastern parts of the country. Emperor Constans II () undertook in 658 the first attempt to restore imperial rule, and although his campaign was mostly carried out in the northern Aegean coast, it seems to have led to a relative pacification of the Slavic tribes in southern Greece as well, at least for a few years. Thus during the great Slavic siege of Thessalonica in the tribe of the Belegezitai, who according to the Miracles of Saint Demetrius were settled around Demetrias and Phthiotic Thebes, provided the besieged city with grain.

The parts of Thessaly that remained in imperial hands after the Slavic invasions—apparently the Aegean coast and the area around the Pagasetic Gulf—came under the theme of Hellas. This was established between 687 and 695, and comprised the eastern coasts of mainland Greece, and possibly the Peloponnese, as well as Euboea and a few other islands. Its strategos was probably based in (Boeotian) Thebes. Given its lack of depth into the hinterland, the theme was originally probably oriented mostly towards the sea and was of a mostly maritime character, as seen during the anti-iconoclast revolt of 726/7. Some time between 730 and 751, the Church in Thessaly, along with the rest of the Illyricum, were transferred from the jurisdiction of the Pope in Rome to that of the Patriarch of Constantinople.

Like much of northern Greece, Thessaly suffered from raids by the Bulgarians, beginning in 773. At the same time, due to conflict between the Bulgarian ruling class and the Slavic population which led to an exodus from the latter, a second wave of Slavic settlement engulfed Greece from on. Unlike the first wave of settlement, this does not seem to have disrupted imperial control in the areas where it had been (re-)established. In 783, however, the eunuch minister Staurakios led a large-scale campaign across Greece from Thessalonica to the Peloponnese, subduing the local Slavs and forcing them to acknowledge imperial overlordship. Despite continued raids by the Bulgarians and Saracen pirates—Demetrias was sacked by Damian of Tarsus in 902 and Thessaly and much of Central Greece devastated by Bulgarian raids in 918 and 923–926—Thessaly, and Greece in general, recovered gradually after Byzantine control was firmly re-established, and there are signs of renewed prosperity and economic activity. Especially in Thessaly, this process manifested itself in the appearance of at least nine new cities, including Halmyros and Stagoi, and the resettlement of older ones, such as Zetounion (ancient Lamia).

Byzantine rule in the 10th–12th centuries

During the course of the 10th century, the Saracen threat receded and was practically ended as the result of the Byzantine reconquest of Crete in 960–961. The threat from Bulgaria remained, however, and in 986, during his wars with Basil II (), the Bulgarian tsar Samuel sacked the city of Larissa and occupied Thessaly. The Bulgarian ruler undertook another large-scale expedition through the province and into the Peloponnese in 997, but on his return he suffered a devastating defeat at the Battle of Spercheios. In the early 11th century, Thessaly was separated from Hellas and joined to the theme of Thessalonica. The Spercheios valley however remained part of Hellas, with the new border running along the Othrys–Agrafa line. The region enjoyed a long period of peace at this time, interrupted only by raids during the uprising of Petar Delyan (1040–1041), plundering by the Uzès in 1064, and the brief Norman attack into Thessaly in 1082–1083, which was beaten back by Emperor Alexios I Komnenos (). The Vlachs are first mentioned in Thessaly during the 11th century, in the Strategikon of Kekaumenos and Anna Komnene's Alexiad. In the 12th century, the Jewish traveler Benjamin of Tudela recorded the existence of the district of "Vlachia" near Halmyros, while the Byzantine historian Niketas Choniates placed a "Great Vlachia" near Meteora. The term is also used by the 13th-century scholar George Pachymeres, and it appears as a distinct administrative unit in 1276, when the pinkernes Raoul Komnenos was its governor (kephale). Thessalian Vlachia was apparently also known as "Vlachia in Hellas".