Near 'Ajjur, at Khirbet Jannaba al-Fauqa, was a probable site of the Battle of Ajnadayn, waged in the 7th-century CE between the Rashidun Caliphate and the Byzantine Empire, and which resulted in a decisive Rashidun victory, incorporating most of Palestine into the domains of Islam. The village of 'Ajjur itself was built during early Fatimid rule in the region in the early twelfth century CE. A mosque was built during this period, and continued to serve 'Ajjur's community until its demise. The village 'Ajjur is believed to be named after "a sort of cucumber."
Ottoman era
Arab chronicler Mujir ad-Din reported that he passed through 'Ajjur on his way from Gaza to Jerusalem in the early sixteenth century, when the village was a part of the Ottoman Empire. By 1596, 'Ajjur was a part of the nahiya of Gaza, part of Sanjak Gaza, with 35 Muslim households; an estimated 193 persons. It paid a find tax rate of 33,3 % on agricultural products, including wheat, barley, fruit, vineyards, beehives, and goats; a total of 5,500 akçe In 1838 Edward Robinson noted the village as being "small", located in the Gaza district. The villagers were Muslim. In 1863 Victor Guérin estimated the population to be around 800. Guérin further noted that several houses, including that of the local Sheikh, were built partly with ancient stones. Socin found from an official Ottoman village list from about 1870 that 'Ajjur had 86 houses and a population of 254, though the population count included men, only. Hartmann found that 'Ajjur had 120 houses. In the 1882, the PEF's Survey of Western Palestine described 'Ajjur as a small village containing olive trees, with most of its houses clustered together, but some dispersed to the west and south. A private school named Abu Hasan was established in this time period. In 1896 the population of 'Ajjur was estimated to be about 1,767 persons.
British Mandate era
In the 1922 census of Palestine conducted by the British Mandate authorities, 'Ajjur had a population of 2,073 inhabitants, all Muslim, increasing in the 1931 census to 2,917; 4 Christians and the rest Muslims, in a total of 566 residential houses. During this period, 'Ajjur became economically active in its vicinity. It held a Friday market or souk that attracted consumers and merchants from nearby towns and villages. A second school was founded in the village in 1934, which served students from nearby villages as well as from 'Ajjur. Like other Arab villages in Palestine at the time, 'Ajjur depended on agriculture, which was the basis of its economy. The main crops were olives and wheat. The second most important economic activity was animal husbandry, in particular, goat herding. Animal ownership was a symbol of social status and pride in the village, and residents gave affectionate names to certain types of animals. Animal herding caused seasonal movement by herders to distant dwellings from the village site, but still in its vicinity such as, Khirbet al-Sura and Khirbet al-'Ammuriyya. Shoe making, carpentry, and tanning were other common occupations in 'Ajjur. In the 1945 statistics, 'Ajjur had a population of 3,730; 10 Christians and 3,720 Muslims, with a total of 58,074 dunams of land. Of this, 2,428 dunums were irrigated or used for plantations, 25,227 dunams used for cereals, while 171 dunams were built-up areas.
On 23 October 1948, during the 1948 Arab-Israeli War, the Fourth Battalion of Israel's Giv'ati Brigade occupied 'Ajjur in the northern front of Operation Yoav, unifying Israeli military operations in the southern and western fronts. Most of 'Ajjur's inhabitants had fled prior to this assault—their flight was triggered by an earlier attack, on 23 July-24. In 1992, the Palestinian historian Walid Khalidi described the village: "Only three houses remain; two are deserted and one has been turned into a warehouse. One of the deserted houses is a two-storey stone structure that has a large, triple-arched front porch." Petersen, who inspected the place in 1994, noted "a large two-storey building with a vaulted arcade on the northern side. The upper part of the building is today used as a house whilst the lower part appears to be abandoned. The arcade consists of three cross-vaulted bays resting on two free-standing piers and two engaged piers at either end. On the outer face of each of the two central piers there is a stone carved with two rosettes which appears to be part of a classical entablature. The outer arches is emphasised by a flat hood moulding. Each bay is covered with a cross-vault which reaches a height of approximately 4m. The upper floor is reached by an external staircase on the east side leading to a walled terrace above the arcade. The identity or function of this building is not known although its design and orientation indicate that it may be a mosque." In 2000, Meron Benvenisti observed that: "Three large, beautiful structures, which were located outside the village amid orchards of fruit trees, have been renovated, and Jewish families live in them. In one, chamber music concerts are held."