After the battles of Jalula (637), Nahavand and Hamadan in 642 between the Arab-Sassanids, the Arabs launched attacks against Azerbaijan. According to al-Tabari, “Azerbaijan was conquered in the year of 22 of Hijri” (642-643). Defeating Sasanids in the battle of Nahavand, the Arabs opened a gateway to the province of Azerbaijan and the territory of Caucasian Albania. The Muslims then invaded Azerbaijan and drew up an agreement with the local population according to which Azerbaijan was surrendered to Caliph Umar on usual terms of paying the annual Jizya.