Rafah has a history stretching back thousands of years. It was first recorded in an inscription of Egyptian Pharaoh Seti I, from 1303 BCE as Rph, and as the first stop on Pharaoh Shoshenq I's campaign to the Levant in 925 BC. In 720 BCE it was the site of the Assyrian king Sargon II's victory over the Egyptians, and in 217 BC the Battle of Raphia was fought between the victorious Ptolemy IV and Antiochus III. (It is said to be one of the largest battles ever fought in the Levant, with over a hundred thousand soldiers and hundreds of elephants).
The town was conquered by Alexander Yannai and held by the Hasmoneans until it was rebuilt in the time of Pompey and Gabinius; the latter seems to have done the actual work of restoration for the era of the town dates from 57 BCE. Rafah is mentioned in Strabo (16,2, 31), the Antonine Itinerary, and is depicted on the Map of Madaba.
A Jewish community settled in the city in the 9th and 10th centuries and again in the 12th, although in the 11th century it suffered a decline and in 1080 they migrated to Ashkelon. A Samaritan community also lived there during this period. Like most cities of southern Palestine, ancient Rafah had a landing place on the coast (now Tell Rafah), while the main city was inland. During the Byzantine period, it was a diocese.
Arab and Mamluk rule
Rafah was an important trading city during the early Arab period, and one of the towns captured by the Rashidun army under general 'Amr ibn al-'As in 635 CE. Under the Umayyads and Abbasids, Rafah was the southernmost border of Jund Filastin ("District of Palestine"). According to Arab geographer al-Ya'qubi, it was the last town in the Province of Syria and on the road from Ramla to Egypt.
In 1226, Arab geographer Yaqut al-Hamawi writes of Rafah's former importance in the early Arab period, saying it was "of old a flourishing town, with a market, and a mosque, and hostelries." However, he goes