He returned to Karabakh after Adil Shah issued a firman (decree) recognizing Panah Ali as the new khan.
Participating in internal politics of his father, he was married with Hurizad, daughter of Armenian melik of Varanda - Shahnazar II, as a tool of marriage alliance.
[1] Ibrahim Khalil emerged victorious thanks to aid by his new relative Umma Khan of Avar Khanate and forced his brother to flee the region.
He aspired to bring most of the Muslim-ruled territory from the Caucasus mountains as far south as Tabriz under his sway,[need quotation to verify] but eventually he had to curb his efforts in the face of the rising Qajar power in Iran.
In August of that year the khan of Quba undertook an unsuccessful campaign again, but in the beginning of 1781 he could penetrate deep into Karabakh and to captured some amount of peasants from there.
As next step, Ibrahim sent two Armenian assassins, Misael bek and his son-in-law Hagop Yuzbashi, to kill Melik Mezhlum of Jraberd.
They came to Heraclius II and the head of the Russian garrison in Tbilisi, Colonel Stepan Burnashev, to ask for troops to fight Ibrahim Khan.
Using opportunity, Ibrahim Khan demanded that Georgia hand over the meliks to him, promising to return three thousand Turkic families who had fled from Borchali to Karabakh in previous years.
In 1795 the ruler of Iran, Agha Mohammad Khan Qajar, attacked the region to bring it again within influence of the Iranian empire.
After a 31 day long siege from July 8 to August 9, Agha Mohammad Khan Qajar failed to take the fortress and left the region.
In 1796, following Agha Mohammad Khan's return to mainland Persia, Catherine the Great ordered her army to conquer the Caucasus.
Using opportunity, Ibrahim and Heraclius teamed up again, this time to invade Ganja Khanate, since its ruler Javad Khan joined Qajar Army in their raid of Tbilisi.
Molla Panah Vagif, khan's vizier was captured by Muhammad bey, son of Mehr Ali Beg Javanshir and claimant to throne after few days.
Ibrahim, who had fled to his in-laws in Avar Khanate, then returned to Shusha and gave Aga Mohammad Khan an honourable burial.