Abhar has served as a vital spot since antiquity due to its location on the route that links
Dinavar to
Qazvin and
Zanjan as well as the central areas of Iran to the region of
Azerbaijan. It was conquered in 643 or 645 by
al-Bara' ibn Azib during the
Arab conquest of Iran. The inhabitants of Abhar initially put up a fierce fight which lasted for several days, but eventually sued for peace, which the Arabs agreed to. Abhar was part of the
Jibal region, which would later in the 11th-12th centuries become known as
Persian Iraq.
Ibn Hawqal, writing in the 10th-century, reports that the inhabitants of Abhar were
Kurds. The
Samanid ruler
Ismail Samani () captured Abhar during his rule. In 916 or 917, Abhar (along with Zanjan, Qazvin, and
Ray) was seized from the Samanids by the
Sajid Yusuf ibn Abi'l-Saj (), the virtually independent governor of the caliphal provinces of Azerbaijan and
Armenia. Yusuf attempted to justify his attack by claiming that the previous caliphal vizier
Ali ibn Isa ibn al-Jarrah had given him the governorship of the region. Most authors, however, consider this claim to be made up. In 917, Wasif al-Baktimuri was given the governorship of Abhar and other areas by the caliph
al-Muqtadir (). In 928, Abhar was briefly seized by the
Alid ruler of northern Iran, Abu Muhammad Hasan ibn Qasim. He was soon ousted from the town by
Asfar ibn Shiruya, who claimed the place for himself. In 930, Asfar was betrayed and ambushed by his
Ziyarid commander
Mardavij, who took over his domains, including Abhar. In 942, the Samanid general
Abu Ali Chaghani captured Abhar. In 997, the ruler of the
Daylamite Sallarid dynasty, Ibrahim II ibn Marzuban II, capitalized on the weak rule of the
Buyid ruler
Majd al-Dawla () by briefly seizing Buyid land in Jibal, including Abhar, Zanjan and
Sohrevard. A coin that was struck in 1013/14 has been found in Abhar, either made under the
Sallarids or their opponents, the
Rawadid dynasty. In 1029, Abhar was conquered by a
Ghaznavid force led by prince
Mas'ud. In 1091, the
Nizari Ismailis seized Sanamkuh, a fortress located in the environs of Abhar. They controlled until 1096, when they were repelled by the
sultan of the
Seljuk Empire,
Berkyaruq (). In 1167, Abhar was attacked by a force led by Inanaj, a commander of the
Eldiguzid dynasty of Azerbaijan. Supported by soldiers sent by the
Khwarazmshah Ala al-Din Tekish () of the
Anushtegin dynasty, Inanaj ran rampant in the town, capturing the women and children before going back to
Khwarazm. In 1217, the Khwarazmshah
Muhammad II () conquered Abhar. Abhar is described in some detail by Hamdallah Mustawfi, who in the 14th-century served as governor of the town along with some other places. He estimated that the length of the
ramparts was 5,500
gams (paces/strides). He commended the
produce of the town, which encompassed of grain and large amount of fruits, especially the
Sijistani pears, Bu Ali plums and black cherries. He also reported that the residents of Abhar had fair skin and were adherents of the
Shafi'i school, and that the grave of Shaykh Abu Bakr ibn Tahir al-Tayyar al-Abhari was located there. The 17th-century French traveler
Jean-Baptiste Tavernier, who had been to Abhar, reported the place in his 1676 book
Les six voyages en Turquie, en Perse et aux Indes as a sizable, ancient town that was now in ruins and home to a community of
Armenians. Another French traveler,
Jean Chardin, who had been to Abhar in 1673, reported that the place had seen several massacres and devastations. He added that the town had large gardens despite having little more than 2,500 houses. He described its inhabitants as Persian-speaking, contrary to its previous populace, which spoke
Turkic. Comte Laurent de Sercey, writing in 1840, reported that Abhar had 800–900 inhabitants and 200 houses.
Zayn al-Abidin Shirvani (died 1837), however, reported that Abhar had 700 houses. During the rule of the
Qajar shah of Iran,
Naser al-Din Shah Qajar (), the royal artillery used Abhar as one of their central bases. ==Demographics==