In Ancient Egypt, the city was known as Tamiat (Coptic: ⲧⲁⲙⲓⲁϯ), but in the Hellenistic period it was called Tamiathis (Greek Ταμίαθις). Mentioned by the 6th-century geographer Stephanus Byzantius, the town later became known as Damiata and as Damietta, which probably derived from an ancient Egyptian word "Damt" that means the ability, since Damietta had the ability to combine the salt water of the Mediterranean Sea and the fresh water of the Nile in one place. Other historians note that the city was called "Tam Heet" which means the city of the water or the city of the running water. Another derivation of the name might be "Tam Hēt", meaning city of North (Coptic: ⲡϯⲙⲉ ϧⲏⲧ).
Under Caliph Omar (579–644), the Arabs took the town and successfully resisted the attempts by the Byzantine Empire to recover it, especially in 739, 821, 921 and 968. The Abbasids used Alexandria, Damietta, Aden and Siraf as entry ports to India and the Tang Empire of China. Damietta was an important naval base during the Abbasid, Tulunid and Fatimid periods. This led to several attacks by the Byzantine Empire, most notably the sack and destruction of the city in May 853.
Damietta was again important in the 12th and 13th centuries during the time of the Crusades. In 1169, a fleet from the Kingdom of Jerusalem, with support from the Byzantine Empire, attacked the port, but it was defeated by Saladin.
During preparations for the Fifth Crusade in 1217, it was decided that Damietta should be the focus of attack. Control of Damietta meant control of the Nile, and from there the crusaders believed they would be able to conquer Egypt. From Egypt they could then attack Palestine and recapture Jerusalem. When the port was besieged and occupied by Frisian crusaders in 1219, Francis of Assisi arrived to peaceably negotiate with the Muslim ruler. The siege devastated the population of Damietta. In October 1218 reinforcements arrived including the Papal Legate Pelagius with the English earls Ranulf of Chester, Saer of Winchester and William Aubigny of Arundel, together with Odonel Aubigny, Robert Fitzwalter, John Lacy of Chester, William Harcourt and Oliver, the illegitimate son of King John. In 1221 the Crusaders attempted to march to Cairo, but were destroyed by the combination of nature and Muslim defences.
Damietta was also the object of the Seventh Crusade, led by Louis IX of France. His fleet arrived there in 1249 and quickly captured the fort, which he refused to hand over to the nominal king of Jerusalem, to whom it had been promised during the Fifth Crusade. However, having been taken prisoner with his army in April 1250, Louis was obliged to surrender Damietta as ransom.
Hearing that Louis was preparing a new crusade, the Mamluk Sultan Baibars, in view of the importance of the town to the Crusaders, destroyed it in 1251 and rebuilt it with stronger fortifications a few kilometres from the river in the early 1260s, making the mouth of the Nile at Damietta impassable for ships.