The Fatimid Imam al-Hakim had also contemplated to extend his authority to Aleppo, the greatest centre of northern Syria. The last Hamdanid ruler, Sa'id ad-Dawla had been killed in 392/1002 by the conspiracy of his minister, called Lulu; who abolished the Hamdanid dynasty in Aleppo and established his own. The real power behind Aleppo was however the Byzantines, who used to be called when their help needed to the rulers. Thus, al-Hakim made a non-aggression pact (hudna) with Basil II, the emperor of Byzantine and weakened the reliance of Aleppo on Byzantine help. There appears different of views as to the negotiation of non-aggression pact (hudna) between the Muslim and Christian empires. Ibn Qalanisi (p. 54) writes that in 390/1000, Barjawan moved first by sending a friendly letter through his Christian secretary, Fahd bin Ibrahim al-Katib, expressing the Fatimid desire for the pact. Antaki (p. 184) however states that the Byzantine emperor, Basil II took the initiative by deputing his two envoys to negotiate peace with the Fatimids. In sum, the agreement was initially for a period of ten years, but it remained enforced through out al-Hakim's period, and the relations between them were strengthened. Envoys and presents were exchanged between the two rulers and trade and commercial activities continued uninterrupted except for a brief period.
The events which occurred in Aleppo after the death of its ruler, Lulu in 399/1008 faciliated al-Hakim's policy and assisted him to achieve his goal. Lulu's son Mansur, succeeding his father, was faced with numerous enemies, including Abul Hayja, the Hamdanid prince who came from Byzantium with Byzantine support to restore the rule of his ancestors. Mansur received investitaure from al-Hakim and virtually became a Fatimid vassal. Al-Hakim supported Mansur against Abul Hayja, who had taken field and defeated.
In 406/1016, Mansur was defeated in a battle by Saleh bin Mirdas, the chief of the Banu Kilab. Mansur took refuge with the Byzantines after leaving a citadel under the control of a certain Fath, who was secretly in contact with al-Hakim. Thus, al-Hakim granted the title of Asad ad-Dawla (lion of the state) to Saleh bin Mirdas and Mubarak ad-Dawla (blessed of the state) to Fath. On the other hand, al- Hakim commanded his troops encamped in Syria to move towards Aleppo to prevent any pact between Saleh and Fath against the Fatimids. In 407/1017, the first Fatimid governor appointed by al-Hakim entered Aleppo, called Fatik, bearing the title of Aziz ad-Dawla. Ibn al-Adim (d. 660/1262) writes in "Zubdat al-Halab fi Tarikh Halab" (Damascus, 1951, 1st vol., p. 214) that al-Hakim issued an edict addressing to the inhabitants of Aleppo that, "When Amir al-mominin learned of the tyranny and ill treatment you suffered from those in powers, burdening you with taxes and harsh imposts out of all proportion to the ways of Islam, he, may God strengthen his power, ordered supplies to be sent to you from the state's stores and to exempt you from the kharaj until the year 407. By this you will know that the light of righteousness has risen and the darkness of tyranny has been dispelled."
The Byzantine emperor however opposed the Fatimid foothold in Aleppo, but did not break the non-agression pact (hubna) with the Fatimids. He put restrictions upon the trade with Aleppo and cemeted his close ties with the Mirdasids in order to employ them against Fatik. The remote distance of Cairo, the threats and offers of his Byzantine contacts and his personal ambition, made it easy for Fatik to show his back to the Fatimids. Soon afterwards, Fatik began to rule as an independent ruler in Aleppo and dismissed the officials appointed by al-Hakim and employed men of his own choice.
On this juncture, al-Hakim realized that a demonstration of the Fatimid arm forces was necessary to maintain his authority in Aleppo, therefore, he ordered his governor in Syria to prepare for a quick expedition against Fatik. On the other side, the troops of the Byzantine also came into action and started moving from the north to the south to support their interests. It was only the sudden death of al-Hakim that had prevented the two empires from breaking peace which had lasted between them for more than 20 years.