In the Fatimid period, Alexandria was the port that received Maghribi or Moroccan and Andalusian or Spanish trade ships headed to Egypt and the Levant. Alexandria also was the port from which goods such as niter and alum, and textiles such as brocade and fabrics from Tanis and Alexandria left Egypt.
Fruit was brought from Alexandria to Al-Fustat in ships, as were textiles and glassware. Alexandria was a famous center of glassware production in the Fatimid period.
The Mamluks sultans also paid attention to Alexandria. Al-Zahir Baybars, for example, paid it four official visits and ordered its walls built and its fortifications consolidated. He also ordered its lighthouse rebuilt and re-dug Al-Khalij channel "Mahmudiyya" channel today, which supplied the city with fresh water.
During the Mamluk period, Alexandria contained a number of shops that sold different kinds of goods such as clothes, textiles, tapestries, and vessels. Many merchants from different countries resided there in merchant inns such as Funduq al-Taybiyya and Funduq al-Marsiliyyin, or The Marseillais. The extensive trading activities used a range of currencies, so money changing establishments called "hawanit al-sarf" were founded.
Alexandria played a significant role not only in international foreign trade but also in local trade as merchants from all over Egypt traveled to it to buy goods at prices lower than the rest of Egypt.
Alexandria was attacked by cities that wished to undermine its high economic status. The most vicious of these attacks was the raid of Peter of Lusignan, the King of Cyprus in AH 767 (AD 1365) during the reign of Sultan al-Ashraf Shaaban. The Mamluk sultans then changed Alexandria from a state to a viceroyalty so that it could be ruled by an important amir on behalf of the sultan.
Rosetta and Damietta were also important centers of trade in Egypt as they, unlike many inner Egyptian cities, were both industrial and commercial centers. They built trade ships and river boats in addition to their flourishing textile industry. They were also the two most important Egyptian ports on the eastern Mediterranean. Both cities were subject to a number of external attacks and the rulers of Egypt over the years took pains to fortify them by consolidating their walls and fortresses in defense against future threats.