Malta has been inhabited since 6400&nbsp;BC initially by Mesolithic hunter gatherers, who were replaced by Neolithic farmers from Sicily around 5400&nbsp;BC. These farmers practiced mixed farming after clearing most of the existing conifer forest that dominated the islands, but their agricultural methods degraded the soil until the islands became uninhabitable. Although it has been claimed that Neanderthals were present on the island, because molar teeth were found in Ghar Dalam cave exhibiting taurodonty, this feature is also found among some modern human teeth and is thus not a definitive indicator that the teeth belong to Neanderthals, and the context of the finds is unclear, so this claim is not widely accepted. <sup>Supplementary material</sup>

Mesolithic (6500–5400 BC)

Malta has been inhabited from at least circa 6500 BC, with the arrival of Mesolithic hunter-gatherers likely originating from Sicily. Discoveries at Latnija Cave led by the Maltese archaeologist Eleanor Scerri included the remains of hearths, stone tools and an abundant and diverse range of animal bones. These included indigenous red deer that are now extinct, fish and marine mammals, as well as abundant edible marine gastropods. To arrive on Malta, these hunter-gatherers had to cross around 100&nbsp;km of open water, documenting the longest yet-known sea crossing by hunter-gatherers in the Mediterranean. However this seems unlikely since recent work suggests these animals went extinct many thousands of years before the arrival of the first people, and no such animals were found in association with the earliest known Mesolithic hunter-gatherers.

Research carried out as part of the FRAGSUS project, comprising analysis of soil cores from valleys, which contained ancient pollen and animal evidence from past environments, revealed that "climate change fluctuations made Malta uninhabitable in some periods of prehistory. There was a substantial break of around 1,000&nbsp;years between the first settlers and the next group who settled permanently on the Maltese islands and eventually built the megalithic temples."

Bronze Age (2350 BC–700 BC)

After the Temple period came the Bronze Age. From this period there are remains of a number of settlements and villages, as well as dolmens — altar-like structures made out of very large slabs of stone. They are claimed to belong to a population certainly different from that which built the previous megalithic temples.

It is presumed the population arrived from Sicily because of the similarity to the constructions found in the largest island of the Mediterranean sea.

One surviving menhir, which was used to build temples, still stands at Kirkop; it is one of the few still in good condition.

Among the most interesting and mysterious remnants of this era are the so-called cart ruts as they can be seen at a place on Malta called Misraħ Għar il-Kbir (informally known as Clapham Junction). These are pairs of parallel channels cut into the surface of the rock, and extending for considerable distances, often in an exactly straight line. Their exact use is unknown. One suggestion is that beasts of burden used to pull carts along, and these channels would guide the carts and prevent the animals from straying. The society that built these structures eventually died out or at any rate disappeared.

Between 1400 BC and 1200 BC there was a Mycenaean influence on the Malta, which is evidenced by presence of Mycenaean artefacts.

Antiquity

Phoenicians and Carthage

thumb|One of the [[Cippi of Melqart which were discovered in Malta]]

Phoenicianspossibly from Tyrebegan to colonize the islands around the early , using it as an outpost from which they expanded sea exploration and trade in the Mediterranean. They called the principal island Ann (, ). Necropolises have been found at Rabat on Malta and Rabat on Gozo, suggesting the main settlements were at present-day Mdina on Malta and Cittadella on Gozo. The former settlement was also known as Ann, suggesting it served as the colony's seat of government. The principal port, meanwhile, was at Cospicua on the Grand Harbor. Known simply as Maleth (, , "The Port"), it was probably the namesake of the Greeks' and Romans' names for the entire island.

The Maltese Islands fell under the hegemony of Carthage around the middle of 6th century BC, along with most other Phoenician colonies in the western Mediterranean. By the late 4th century BC, Malta had become a trading post linking southern Italy and Sicily to Tripolitania. This resulted in the introduction of Hellenistic features in architecture and pottery. It is not known if Malta was settled like a traditional Greek , so some support that Malta was never a Greek colony. Hellenistic architectural features can be seen in the Punic temple at Tas-Silġ and a tower in Żurrieq. The Greek language also began to be used in Malta, as shown in the bilingual Phoenician and Greek inscriptions found on the Cippi of Melqart. In the 18th century, French scholar Jean-Jacques Barthélemy deciphered the extinct Phoenician alphabet using the inscriptions on these cippi.

Serving as the administrative hub of the islands, Mdina also became known as Melita. Its size grew to its maximum extent, occupying the entire area of present-day Mdina and large parts of Rabat, extending to what is now St Paul's Church. Remains show that the city was surrounded by thick defensive walls and was also protected by a protective ditch that ran along the same line of St Rita Street, which was built directly above it. Remains hint that a religious centre with a number of temples was built on the highest part of the promontory. The remains of one impressive residence known as the Domus Romana have been excavated, revealing well-preserved Pompeian style mosaics. This seems to have been the residence of a rich Roman aristocrat, and it is believed to have been built in the 1st century BC and abandoned in the 2nd century AD.

thumb|right|Greek-Roman remains at the [[Malta Maritime Museum]]

The islands prospered under Roman rule, and were eventually distinguished as a Municipium and a Foederata Civitas. Many Roman antiquities still exist, testifying to the close link between the Maltese inhabitants and Sicily. Throughout the period of Roman rule, Latin became Malta's official language, and Roman religion was introduced in the islands. Despite this, the local Punic-Hellenistic culture and language is thought to have survived until at least the 1st century AD. but there is no archaeological evidence to support this.

Middle Ages

Byzantine rule

thumb|Remains of a Byzantine basilica at [[Tas-Silġ, which was built on the site of earlier megalithic and Punic-Roman temples]]

In 533, Byzantine general Belisarius may have landed at Malta while on his way from Sicily to North Africa, and by 535, the islands were integrated into the Byzantine province of Sicily. During the Byzantine period, the main settlements remained the city of Melite on mainland Malta and the Citadel on Gozo, while Marsaxlokk, Marsaskala, Marsa and Xlendi are believed to have served as harbours. The relatively high quantity of Byzantine ceramics found in Malta suggests that the island might have had an important strategic role within the empire from the 6th to 8th centuries.

From the late 7th century onward, the Mediterranean was being threatened by Muslim expansion. At this point, the Byzantines probably improved the defences of Malta, as can be seen by defensive walls built around the basilica at Tas-Silġ around the 8th century. The Byzantines might have also built the retrenchment which reduced Melite to one-third of its original size.

Arab period

thumb|The [[Maymūnah Stone, a 12th-century marble tombstone believed to have been found in Gozo]]

In 870 AD, Malta was occupied by Muslims from North Africa. According to Al-Himyarī, Aghlabids led by Halaf al-Hādim besieged the Byzantine city of Melite, which was ruled by governor Amros (probably Ambrosios). Al-Hādim was killed in the fighting, and Sawāda Ibn Muḥammad was sent from Sicily to continue the siege following his death. The duration of the siege is unknown, but it probably lasted for some weeks or months. After Melite fell to the invaders, the inhabitants were massacred, the city was destroyed and its churches were looted. Marble from Melite's churches was used to build the castle of Sousse.

According to Al-Himyarī, Malta remained almost uninhabited until it was resettled in around 1048 or 1049 by a Muslim community and their slaves, who rebuilt the city of Melite as Medina, making it "a finer place than it was before". However, archaeological evidence suggests that Melite/Medina was already a thriving Muslim settlement by the beginning of the 11th century, so Al-Himyarī's account might be unreliable.

In 1053–54, the Byzantines besieged Medina but they were repelled by its defenders.

Norman Kingdom of Sicily rule

thumb|[[Palazzo Falzon, which was built between the late 15th and mid 16th centuries. It is the second oldest surviving building in Mdina.]]

Malta returned to Christian rule with the Norman conquest. It was, with Noto on the southern tip of Sicily, the last Arab stronghold in the region to be retaken by the resurgent Christians. In 1091, Count Roger I of Sicily, invaded Malta and turned the island's Muslim rulers into his vassals. In 1127, his son Roger II of Sicily fully established Norman rule in Malta, paving the way for the islands' Christianization.

Malta was part of the Kingdom of Sicily for nearly 440 years. During this period, Malta was sold and resold to various feudal lords and barons and was dominated successively by the rulers of Swabia, Anjou, the Crown of Aragon, the Crown of Castile and Spain. Eventually, the Crown of Aragon, which then ruled Malta, joined with Castile in 1469, and Malta became part of the Spanish Empire.

Meanwhile, Malta's administration fell in the hands of local nobility who formed a governing body called the Università.

The islands remained largely Muslim-inhabited long after the end of Arab rule. The Arab administration was also kept in place and Muslims were allowed to practise their religion freely until the 13th century. Muslims continued to demographically and economically dominate Malta for at least another 150&nbsp;years after the Norman conquest.

Even in 1175, Burchard, bishop of Strasbourg, an envoy of Frederick I, Holy Roman Emperor, had the impression, based upon his brief visit to Malta, that it was exclusively or mainly inhabited by Muslims.

In 1192, Tancred of Sicily appointed Margaritus of Brindisi the first Count of Malta, perhaps for his unexpected success in capturing Empress Constance contender to the throne. Between 1194 and 1530, the Kingdom of Sicily ruled the Maltese islands and a process of gradual Italianization and Christianization started in Malta.

In 1224, Frederick II, Holy Roman Emperor, sent an expedition against Malta to establish royal control and prevent its Muslim population from helping a Muslim rebellion in the Kingdom of Sicily.

After the Norman conquest, the population of the Maltese islands kept growing mainly through immigration from the north (Sicily and Italy), with the exile to Malta of the entire male population of the town of Celano (Italy) in 1223, the stationing of a Norman and Sicilian garrison on Malta in 1240 and the settlement in Malta of noble families from Sicily between 1372 and 1450. As a consequence of this, Capelli et al. found in 2005 that "the contemporary males of Malta most likely originated from Southern Italy, including Sicily and up to Calabria."

According to a report in 1240 or 1241 by Gililberto Abbate, who was the royal governor of Frederick II of Sicily during the Genoese Period of the County of Malta, in that year the islands of Malta and Gozo had 836&nbsp;Muslim families, 250&nbsp;Christian families and 33&nbsp;Jewish families.

Around 1249, some Maltese Muslims were sent to the Italian colony of Lucera, established for Sicilian Muslims.