Remains from the fifth and sixth century CE have been found here, together with Byzantine ceramics. Hamama is identified as the fifth century CE Byzantine town of Peleia. Peleia translates as "dove", and when the Arabs conquered it through the Rashidun Caliphate in the seventh century, the town received its Arabic nameHamama meaning "dove", reflecting its Byzantine roots. Hamama was located near the site of a battle in 1099 between the Crusaders and the Fatimids, resulting in a Crusader victory. Later Hamama passed into MuslimMamluk hands, and by 1333/4 CE some of the income from the village formed part of a waqf of the tomb and madrasa of Aqbugha b. Abd Allah in Cairo. In 1432, it is reported that the Mamluk sultan Barsbay passed through the village. In this period, a renowned scholar and preacher at the al-Aqsa Mosque, Ahmad al-Shafi'i, was born there.
Ottoman era
Hamama, like the rest of Palestine, was incorporated into the Ottoman Empire in 1517, and in the tax registers of 1596 it appeared as being in the a village in the nahiya of Gaza, with a population of 84 Muslim households, an estimated 462 persons. The villagers paid taxes on goats and beehives, in addition to occasional revenues; a total of 6,800 akçe. All of the revenue went to a waqf. The seventeenth-century traveller al-Nabulsi recorded that the tomb of Shaykh Ibrahim Abi Arqub was located in the village, while the Syrian Sufi teacher and traveller Mustafa al-Bakri al-Siddiqi visited Hamama in the first half of the eighteenth century, after leaving al-Jura. Hamama appears on Jacotin's map drawn-up during Napoleon's invasion in 1799, though its position is interchanged with that of Majdal. In 1838, Hamameh was noted as a Muslim village in the Gaza district. In 1863, the French explorerVictor Guérin visited the village, and noted a mosque constructed with ancient materials. An official Ottoman village list from about 1870 showed that Hamame had 193 houses and a population of 635, although it only counted the men.
British Mandate era
Under the British Mandate in Palestine, a village council was established to administer local affairs, and Hamama had a mosque, and two primary schools for boys and girls established in 1921. In the 1922 census of Palestine, conducted by the British Mandate authorities, Hamama had a population of 2,731; 2,722 Muslims and 9 Christians, where all the Christians were Orthodox. The population had increased in the 1931 census to 3,405; 3,401 Muslims and 4 Christians, in a total of 865 houses. In the 1945 statistics Hamama had a population of 5,070; 5,000 Muslims, 10 Christians and 60 Jews, with a total of 41,366 dunams of land, according to an official land and population survey. Of this, 1,356 dunams were used for citrus and bananas, 4,459 dunams were for plantations and irrigable land, 28,890 for cereals, while 167 dunams were built-up land. In 1946, the boys' school had an enrollment of 338, and the girls' school an enrollment of 46. Its inhabitants engaged primarily in fishing and agriculture, cultivating grain, citrus, apricots, almonds, figs, olives, watermelons, and cantaloupes. Due to the existence of sand dunes in the north part of the town, trees were planted on parts of those lands to prevent soil erosion. During the Mandate time, the village was visited by inspectors from the Department of Antiquities who noted two mosques. One of these, known as Shaykh Ibrahim Abi Arqub, included marble columns and capitals in the iwan. The other mosque, known as Shaykh Hamid, also incorporated marble fragments. Neither of these mosques have survived.
1948, and aftermath
According to reports published by the newspaper Felesteen, Hamama was first drawn into the 1948 Arab-Israeli War after a group of workers from the town laboring in the adjacent fields were struck by Jewish residents from Nitzanim on January 22, 1948, leaving fifteen Arabs wounded. Two days later, a unit from Nitzanim opened fire on Hamama residents, killing one, and on February 17, a group of workers waiting for a bus on the road between Isdud and the town were fired upon, wounding two. It was captured by Israel from the Egyptian Army in the first stage of Operation Yoav on October 28. By then several refugees from nearby towns were in Hamama, most of them, along with many of Hamama's residents, fled with the withdrawing Egyptian troops. At the end of November 1948, Coastal Plain District troops carried out sweeps of the villages around and to the south of Majdal. Hamama was one of the villages named in the orders to the IDF battalions and engineers platoon, that the villagers were to be expelled to Gaza, and the IDF troops were "to prevent their return by destroying their villages." The path leading to the village was to be mined. The IDF troops were ordered to carry out the operation "with determination, accuracy and energy". The operation took place on 30 November. The troops found "not a living soul" in Hamama. However, the destruction of the villages was not completed immediately due to the dampness of the houses and the insufficient amount of explosives. Mohammed Dahlan's family is originally from Hamama. In 1992 it was noted: "No traces of village houses or landmarks remain. The site is overgrown with wild vegetation, including tall grasses, weeds, and bushes. It also contains cactuses. The surrounding land is unused."