Battle of Tawahin

The Battle of Tawahin () was fought in 885 between the forces of the Abbasid Caliphate under Abu'l-Abbas ibn al-Muwaffaq (the future Caliph al-Mu'tadid) and the autonomous Tulunid ruler of Egypt and Syria, Khumarawayh. The battle took place near Ramlah (modern Israel) and ended with a Tulunid victory. 
Following Khumarawayh's ascension to power in 884, the Abbasid central government decided to reassert its control over the provinces ruled by him and invaded northern Syria that year. By early 885 the conflict was proceeding favorably for the Abbasids, forcing Khumarawayh to personally take the field and try to stop their advance toward Egypt. In the battle that followed, the Abbasid troops initially defeated the Tulunids and plundered Khumarawayh's camp, but were then ambushed by a Tulunid reserve force and routed in turn.
As a result of the battle, the Abbasid forces were forced to withdraw from Syria, and Tulunid control over the province was reaffirmed. In the following year the Abbasid government agreed to a treaty which formally recognized Khumarawayh's rule over both Egypt and Syria.
Background.
Ahmad ibn Tulun, a Turkish soldier, had managed to become governor of Egypt in 868. By using the country's immense wealth to raise an army of his own, and exploiting the instability of the central Abbasid government, over the next years he became "de facto" autonomous, although he continued to acknowledge the suzerainty of the Abbasid caliph—for most of his reign the powerless al-Mu'tamid—and to forward some tax revenue to the central government. Ibn Tulun's power made him a major rival to the real power behind the Abbasid throne, al-Mu'tamid's brother and regent al-Muwaffaq. The latter tried in 877 to wrest Egypt from Ibn Tulun, but the attempt failed spectacularly, and in the following year Ibn Tulun extended his area of control over Syria up to the border zone with the Byzantine Empire in the north and up to Raqqa in the western Jazira in the east, immediately adjacent to the Abbasid metropolitan province of Iraq.
Relations between Ibn Tulun and al-Muwaffaq were further strained when al-Mu'tamid tried to play off the two men against each other to regain his own authority and independence. In 882 the caliph attempted to escape from his brother's control by fleeing to Ibn Tulun's domain, but he was apprehended en route by Ishaq ibn Kundaj, the governor of the Jazira and Mosul, and was sent back to Iraq. This led to a formal breach in relations; al-Muwaffaq ordered that Ibn Tulun be publicly cursed in mosques throughout the empire and stripped of his governorships in favour of Ishaq ibn Kundaj, while Ibn Tulun similarly had al-Muwaffaq publicly cursed, declared him deposed from his position as al-Mu'tamid's second heir, and proclaimed a "holy war" against him.
When Ibn Tulun died in May 884, he was succeeded by his second son, Khumarawayh, with the approval of the Tulunid grandees but not the Abbasid court. Immediately al-Muwaffaq ended the ongoing negotiations that he had been conducting with Ibn Tulun, and refused to recognize Khumarawayh's rule over Egypt and Syria. A prominent Tulunid general, Ahmad ibn Muhammad al-Wasiti, then defected to al-Muwaffaq, and urged him to make war on the "young and inexperienced" Khumarawayh and recover the latter's provinces for the central government.
Prelude: Abbasid invasion of Syria.
The initial Abbasid invasion was led by Ishaq ibn Kundaj, appointed as the nominal governor of Syria and Egypt, and another general, Muhammad ibn Diwdad Abu'l-Saj. After receiving encouragement from al-Muwaffaq, who promised to send them reinforcements, the two commanders marched into Syria in mid-884. The Tulunid governor of Damascus soon defected to their side, and they were able to take control of Antioch, Hims, and Aleppo. Upon learning of the Abbasid advance, Khumarawayh sent troops to Syria. The Tulunid army first proceeded to Damascus, where they succeeded in forcing its rebel governor to flee, and then advanced to Shayzar on the Orontes. The onset of winter, however, resulted in a lull in hostilities, and both sides remained in their camps to wait out the season.
Eventually the reinforcements that al-Muwaffaq had promised arrived from Iraq under the command of his own son, Abu'l-Abbas. The combined Abbasid forces advanced to Shayzar, where the Tulunid army was still encamped. The latter was caught completely by surprise and was defeated; many of the Egyptians were killed in the fighting. The survivors fled to Damascus, but upon learning that the Abbasid army was headed for them they abandoned the city, allowing the Abbasids to retake it in February 885. The Tulunid forces continued south to Ramlah in the district of Palestine, where they wrote to Khumarawayh of what had transpired. Khumarawayh now decided to personally lead his troops against the Abbasids, and departed from Egypt for Syria.
At the same time, Abu'l-Abbas set out from Damascus and headed for Ramlah, during which he learned of Khumarawayh's arrival in Syria. At this point, however, the Abbasid offensive was hampered by a dispute between its commanders, which was caused when Abu'l-Abbas accused Ishaq ibn Kundaj and Ibn Abu'l-Saj of cowardice. In response to this insult, the two generals decided to abandon the campaign, and left Abu'l-Abbas to face Khumarawayh's forces by himself.
Battle of Tawahin.
The two armies met at a village called at-Tawahin ("the Mills"), situated between Ramlah and Damascus, on 5/6 April 885 (although later Egyptian sources like al-Maqrizi give the date, probably erroneously, as 7 August). Khumarawayh reportedly had a significant numerical advantage, thanks in part to the departure of Ishaq ibn Kundaj and Ibn Abu'l-Saj; according to al-Kindi, the Tulunid army numbered 70,000 while Abu'l-Abbas had only 4,000 men. Despite this, the first engagement between the two armies went favorably for the Abbasids. Khumarawayh quickly lost his nerve and fled, according to al-Tabari, "on the back of a donkey" back to Egypt with part of his army.
Believing that they had won the battle, the Abbasid troops proceeded to plunder the Tulunid camp, with Abu'l-Abbas installing himself in Khumarawayh's own tent. A part of the Tulunid army, however, under Sa'd al-Aysar, had remained behind and prepared to ambush Abu'l-Abbas' forces. Once the Abbasids, secure in their success, "had already laid down their arms and settled in their quarters", Sa'd al-Aysar's men attacked and routed them, inflicting severe casualties and killing several senior commanders. Abu'l-Abbas, who mistakenly thought that Khumarawayh had returned to the fight, decided to flee with what men he had left, and the Tulunids plundered his camp in turn.
Aftermath.
Following the battle, Abu'l-Abbas and a "very few" of his men who had managed to escape made a disorganized retreat to the north. They first reached Damascus, whose inhabitants refused to allow him entry, and then proceeded to Tarsus near the Byzantine frontier. After spending some time at Tarsus, they were ousted from the city by its residents in mid-885, at which point Abu'l-Abbas decided to withdraw from Syria and return to Iraq.
Khumarawayh learned of the outcome of the battle in Egypt. Rejoicing upon hearing of Sa'd al-Aysar's victory, he quickly sent back his forces to Syria and re-established his authority over it. A large part of the Abbasid army was captured and transported to Egypt, where Khumarawayh, in a gesture aimed at reconciliation with the caliphal government, allowed those soldiers who wanted to return to Iraq depart without ransom, while offering the rest the opportunity to settle in Egypt. 
The victorious Sa'd al-Aysar went to Damascus, where he rebelled against Khumarawayh, but was defeated and killed. 
Over the next couple of years, Khumarawayh followed up on the victory and succeeded in considerably extending his realm. In late 886, he launched an offensive against the Jazira; Ishaq ibn Kundaj was defeated and forced to flee, and the province came under the Tulunid sphere of influence. Shortly after this, Khumarawayh began negotiations with al-Muwaffaq, and a treaty was signed in December 886 whereby the Abbasid government recognized Khumarawayh as hereditary ruler in his possessions for thirty years. Subsequent attempts by both Ishaq ibn Kundaj and Ibn Abu'l-Saj to retake the Jazira failed, and Ishaq ibn Kundaj eventually submitted to Khumarawayh. In 890 Yazman al-Khadim, the governor of Tarsus, also declared allegiance to him, thus bringing Cilicia under Tulunid control as well. 
The Tulunid triumph was to prove ephemeral, however. In 893 Abu'l-Abbas, now Caliph, succeeded in regaining the Jaziran provinces by treaty, and after Khumarawayh's death in 896, took advantage of Tyulunid weakness to recover northern Syria and Cilicia as well. Finally, in 905 the Abbasids launched a campaign that rapidly brought about the end of Tulunid autonomy and fully re-incorporated their lands into the Caliphate.