The history of the city of Thessaloniki dates back to the ancient Macedonians. Today with the opening of borders in Southeastern Europe it is currently experiencing a strong revival, serving as the prime port for the northern Greek regions of Macedonia and Thrace, as well as for the whole of Southeastern Europe.

Hellenistic era

The town was founded around 315 BC by King Cassander of Macedon, on or near the site of the ancient town of Therma and twenty-six other local villages. Cassander named the new city after his wife Thessalonike, a half-sister of Alexander the Great. Her name ("victory of Thessalians", from Greek: nikē "victory") commemorated her being born on the day her father, Philip II, won a battle with the help of Thessalian horsemen. Thessaloniki developed rapidly and as early as the 2nd century BC, it had its first walls built, which enclosed and protected the city. The city also came to be an autonomous part of the Kingdom of Macedon, with its own parliament where a King was represented that could interfere in the city's domestic affairs.

Ancient/Classical Roman era

After the fall of the Kingdom of Macedon in 168 BC, Thessalonica as it came to be called in Latin, became a city of the Roman Republic. It grew to be an important trade-hub located on the Via Egnatia, the Roman road connecting Byzantium (later Constantinople) with Dyrrhachium (now Durrës in Albania), which facilitated trade between Europe and Asia. The city became the capital of one of the four Roman districts of Macedonia, and, for a short time in the 1st century BC, was the capital for all the Greek provinces. It kept its privileges but was ruled by a praetor and had a Roman garrison. Due to the city's key commercial importance, a spacious harbour was built by the Romans, the famous Burrowed Harbour (Σκαπτός Λιμήν) that accommodated the city's trade, up to the 18th century. Later, with the help of silt deposits from the Axios river, land was reclaimed and the port was expanded. Remnants of the old harbour's docks can be found in present-day under Frangon Street, near the city's Catholic Church.

Thessaloniki's acropolis, located in the northern hills, was built in 55 BC for security reasons, following Thracian raids in the city's outskirts at the time.

About 50 AD, while on his second missionary journey, Paul the Apostle reasoned with the Jews from the Scriptures in this city's chief synagogue on three Sabbaths and sowed the seeds for Thessaloniki's first Christian church. During Paul's time in the city, he convinced some people among both Jews and Greeks to adopt Christian beliefs, as well as some of the city's leading women. However, Jews who kept their faith no longer wished for sectarian strife in their synagogues, and banned Paul and his companions from their midst; assembled a mob, started a riot, and famously accused the apostolic company of "turning the world upside down". Because they were no longer welcome, Silas and Timothy were eventually sent out of Thessaloniki by the new Christian converts. From there the evangelizers went to Veroia, aka Berea, where they succeeded in converting some people in that city as well. The three men eventually continued their travels, and Paul wrote two letters to the new church at Thessaloniki, probably between 51 and 53, the First Epistle to the Thessalonians and the Second Epistle to the Thessalonians.

An inscription discovered in Thessaloniki and published in 1953 provides evidence for a Samaritan community in the city. Two lines are written in Samaritan script with blessings ("Blessed be our God forever … blessed be His name forever"), while the remaining lines are in Greek, including a passage from Numbers 6:22–27 and a donor dedication. The inscription has been dated on paleographic grounds to between the 4th and 6th centuries CE and is generally associated with a Samaritan synagogue.

In 306, Thessaloníki acquired a patron saint, St. Demetrius. Christians credited him with a number of miracles that saved the city. He was the Roman Proconsul of Greece, under the emperor Maximian. Demetrius was killed at a Roman prison, where the Church of St. Demetrius lies today. The church was first built by the Roman sub-prefect of Illyricum, Leontios, in 463. Other important remains from this period include the Arch and Tomb of Galerius, located in the city centre of the modern Thessaloniki.

Byzantine Roman era and intermittent foreign occupations; Late Antiquity to Late Middle Ages

When the Roman Prefecture of Illyricum was divided between the East and West Roman halves in 379, Thessaloniki became the capital of the new Prefecture of Illyricum (reduced in size). Its importance was second only to Constantinople itself in the neighboring Balkan and Aegean area, while in 390 it was the location of a revolt against the emperor Theodosius I and his Gothic mercenaries. Butheric, their general, together with several of his high officials, were killed in an uprising triggered by the imprisoning of a favorite local charioteer for pederasty with one of Butheric's slave boys.Gibbon, The Decline and Fall of the Roman Empire, ch.27 2:56 7,000 - 15,000 of the citizens were massacred in the city's hippodrome in revenge – an act which earned Theodosius a temporary excommunication.

A quiet interlude followed until repeated barbarian invasions after the fall of the Western Roman Empire, while a catastrophic earthquake severely damaged the city in 620, resulting in the destruction of the Roman Forum and several other public buildings. Thessaloniki itself came under attack from Slavs in the 7th century (most notably in 617 and 676–678); however, they failed to capture the city. Byzantine brothers Saint Cyril and Saint Methodius were born in Thessaloniki and it was Byzantine Emperor Michael III who encouraged them to visit the northern regions as missionaries where they adopted the South Slavonic speech as the basis for the Old Church Slavonic language. In the 9th century, the Byzantines decided to move the market for Bulgarian goods from Constantinople to Thessaloniki. Tsar Simeon I of Bulgaria subsequently invaded Thrace, defeated a Byzantine army and forced the empire to move the market back to Constantinople. In 904, Saracens, led by Leo of Tripoli, managed to seize the city and after a ten-day depredation, left after having freed 4,000 Muslim prisoners while capturing 60 ships,Faith and sword: a short history of Christian-Muslim conflict by[Alan G. Jamieson, pg.32 and gaining a large loot and 22,000 slaves, mostly young people.cf. the account of John Kaminiates

Following these events, the city recovered and the gradual restoration of Byzantine power during the 10th, 11th, and 12th centuries brought peace to the area. According to Benjamin of Tudela, a Jewish community of at least 500-strong existed in the 12th century when he visited there. During that time the city came to host the fair of Saint Demetrius every October, which was held just outside the city walls and lasted six days.

The economic expansion of the city continued throughout the 12th century as the rule of the Komnenoi emperors expanded Byzantine control into Serbia and Hungary, to the north. The city is known to have housed an imperial mint at this time. However, after the death of the emperor Manuel I Komnenos in 1180, the fortunes of the Byzantine Empire began to decline and in 1185, Norman rulers of Sicily, under the leadership of Count Baldwin and Riccardo d'Acerra, attacked and occupied the city, resulting in considerable destruction. Nonetheless, their rule lasted less than a year and they were defeated by the Byzantine army in two battles months later, forcing them to evacuate the city.

Thessaloniki passed out of Byzantine hands in 1204, when Constantinople was captured by the Fourth Crusade. Thessaloniki and its surrounding territory — the Kingdom of Thessalonica — became the largest fief of the Latin Empire, covering most of north and central Greece. The city was given by emperor Baldwin I to his rival Boniface of Montferrat, but was seized back once more in 1224 by Theodore Komnenos Doukas, the Greek ruler of Epirus, who established the Empire of Thessalonica. After the Battle of Klokotnitsa in 1230, Tsar Ivan Asen II of Bulgaria made the rulers of Thessaloniki his vassals. The city became subordinated to the Empire of Nicaea in 1242, when its ruler, John Komnenos Doukas, lost his imperial title, and was fully annexed in 1246.

At this time, despite intermittent invasion, Thessaloniki sustained a large population and flourishing commerce, resulting in intellectual and artistic endeavour that can be traced in the numerous churches and frescoes of the era and by the evidence of its scholars teaching there, such as Thomas Magististos, Demetrios Triklinios, Nikephoros Choumnos, Constantine Armenopoulos, and Neilos Kabasilas. Examples of Byzantine art survive in the city, particularly the mosaics in some of its historic churches, including in the church of Hagia Sophia and the church of Saint George.

In the 14th century, however, the city faced upheaval in the form of the Zealot social movement (1342–1349), springing from a religious conflict between bishop Gregory Palamas, who supported conservative principles, and the monk Barlaam. Quickly, it turned into a political anti-aristocratic movement during the Byzantine civil war of 1341–47, leading to the Zealots ruling the city from 1342 until 1349.

Ottoman era

The Byzantine Empire, unable to hold the city against the Ottoman Empire's advance, handed it over in 1423 to the Republic of Venice. Venice held the city until it was captured after a three-day-long siege by the Ottoman Sultan Murad II, on 29 March 1430. The Ottomans had previously captured Thessaloniki in 1387, but lost it in the aftermath of their defeat in the Battle of Ankara against Tamerlane in 1402, when the weakened Ottomans were forced to hand back a number of territories to the Byzantines. During the Ottoman period, the city's Muslim and Jewish population grew. By 1478, Thessaloniki had a population of 4,320 Muslims between 6,094 Greek Orthodox inhabitants. By c. 1500, the numbers of Muslims grew to 8,575 Muslims, with Greeks numbering at 7,986, making them a minority. Around the same time, Sephardic Jews began arriving from Spain. The Expulsion of Jews from Spain, promulgated by Catholic King Ferdinand and Queen Isabella, forced Jews to either convert to Christianity, or be exiled, while alleged "fake converts" (marranos) were tortured and burned with the support of the Inquisition. Wanting to dilute Greek nationalism and weaken it, the Ottoman Emperor invited Jews to resettle in his territories, which included Salonica. In c. 1500, there were approximately 3,770 Jews, but by 1519, according to Ottoman archives, the population of Thessaloniki numbered 6,870 Muslims, 6,635 Christians, and 15,715 Jews, the last coming to form 54% of the city's population. Sephardic Jews, Muslims and Greek Orthodox remained the principal groups in the city for the next 400 years.The New Cambridge Medieval History p. 779 - Rosamond McKitterick, Christopher Allmand.

The city came to become the largest Jewish city in the world and remained as such for at least 200 years, often called "Mother of Israel". Of its 130,000 inhabitants at the start of the 20th century, around 60,000 were Sephardic Jews.Mark Mazower, Salonica, City of Ghosts: Christians, Muslims and Jews, 1430-1950, London: HarperCollins, 2004. Some Romaniote Jews were also present.for a review of recent work on the Jewish community of Thessaloniki, see Andrew Apostolou, "Mother of Israel, Orphan of History: Writing on Jewish Salonika", Israel Affairs 13:1:193-204