Caliph Al-Ma'mun sent general Yahya ibn Mu'adh who fought against Babak in 819–820, but could not defeat him. Two years later Babak overcame the forces of Isa ibn Muhammad ibn Abi Khalid. In 824–825, the Caliphate generals Ahmad ibn al Junayd and Zorayq b. ′Alī b. Ṣadaqa were sent to subdue Babak's revolt. Babak defeated them and captured Jonayd. In 827–828 Moḥammad b. Ḥomayd was sent to overcome Babak. Despite several victories, his troops were defeated by Babak during the last battle at Hashtadsar in 829. Caliph Al-Ma′mun's moves against Babak had failed when he died in 833. Babak's victories over Arab generals were associated with his possession of Badd fort and the inaccessible mountain stronghold, according to Arab historians who mentioned that his influence also extended to the territories of today’s Azerbaijan Republic- "southward to near Ardabīl and Marand, eastward to the Caspian Sea and the Shamakhi district and Shervan, northward to the Mughan (Moḡān) steppe and the Aras river bank, westward to the districts of Julfa, Nakhchivan, and Marand". The last battle between the Arab caliphate and the Khurramites took place in the fortress of Badd on 837. The Khurramites were defeated and Afshin reached Badd. Afshin had additional forces from the Caliphate under the Arab magnate Abū Dolaf and settled in a camp six miles away from Badd fortress. He used this camp as a base for mountain attacks against Badd. After setting up siege machinery and naphtha-throwers, he was able to invade Badd. The Khurramites were defeated and after capturing the Badd fortress, Babak escaped, but was later captured and executed. Present day The remaining parts of the fortress are currently known as Qaḷʿa-ye Jomhūr. It is situated 50km from Ahar on the left branch of Qarasū river. A castle and a palace on the top of a mountain remain from the Badd fort. The castle was included in the list of national, historical and cultural places in 1966. It was then renovated by the Cultural Heritage Organization of Iran and is used as a hiking destination. Coin and pottery samples have been found belonging to the 13th century. Among these findings were also carved and glazed potteries, dating to the beginning of the 7th century. Gallery See also Iranian architecture Arasbaran forests Atashgah Castle Notes External links More Pictures in Tishineh Buildings and structures completed in the 3rd century BC Castles in Iran Buildings and