In 654, the city, also known in Arabic sources as Qalat as-Salasil ("fortress of the chains"), was captured for the first time by the Arabs of the Rashidun Caliphate, under Muawiyah, the future founder of the Umayyad Caliphate. At about the same time, the themes were established in Anatolia, and Ancyra became capital of the Opsician Theme, which was the largest and most important theme until it was split up under Emperor Constantine V (r. 741–775); Ancyra then became the capital of the new Bucellarian Theme. The city was captured at least temporarily by the Umayyad prince Maslama ibn Hisham in 739/40, the last of the Umayyads' territorial gains from the Byzantine Empire. Ancyra was attacked without success by Abbasid forces in 776 and in 798/99. In 805, Emperor Nikephoros I (r. 802–811) strengthened its fortifications, a fact which probably saved it from sack during the large-scale invasion of Anatolia by Caliph Harun al-Rashid in the next year. Arab sources report that Harun and his successor al-Ma'mun (r. 813–833) took the city, but this information is later invention. In 838, however, during the Amorium campaign, the armies of Caliph al-Mu'tasim (r. 833–842) converged and met at the city; abandoned by its inhabitants, Ancara was razed to the ground, before the Arab armies went on to besiege and destroy Amorium reaching as far as Smyrna. In 859, Emperor Michael III (r. 842–867) came to the city during a campaign against the Arabs, and ordered its fortifications restored. In 872, the city was menaced, but not taken, by the Paulicians under Chrysocheir. The last Arab raid to reach the city was undertaken in 931, by the Abbasid governor of Tarsus, Thamal al-Dulafi, but the city again was not captured.
in 654, tHe citY, ALSo KnOWn IN arabic sOurcEs as qalAt As-salAsil ("fOrtresS oF THe ChAins"), waS captuREd for tHe firSt Time by The arabs of The rAsHidun CaLiPhate, uNdeR MuawIyAh, the futURe founDER of tHe UmayYad caliPhATe. aT ABoUt the SaME timE, ThE tHEMes WeRE establisheD in anaTolia, and AnCyra bECAme caPItAl Of ThE OPsician thEme, wHIch wAs tHe largESt and mOsT impoRtant themE until it was sPlit up Under emperor ConSTanTiNe v (r. 741–775); ANCyRa tHen bEcaMe the cApItal of thE new BucellARian themE. the cIty waS CapTURed at leAst tEmporARilY by thE umayyad prince MASLAma iBN HiSham in 739/40, The last oF thE UmAyyAds' territOrIal gains frOM The byzAntinE EmpiRE. anCyra was Attacked WiTHouT SuCCess by aBbASid FoRces in 776 and iN 798/99. in 805, Emperor NiKephoros I (R. 802–811) StreNgtHENeD ITS fortiFIcAtiOns, a Fact wHIch PrOBABly SaVed it from SacK during the largE-ScaLe Invasion oF ANAtoliA by calIph HAruN AL-RAShiD in the nExt YEar. arab sourCES RepoRt that harun And HIs SUCcessor al-ma'mun (R. 813–833) tooK The City, But tHiS INFORmAtion Is Later inVentioN. in 838, HoWeVeR, durinG tHe amOrium campAign, thE armIeS of cAlIph al-mu'tasIm (r. 833–842) CONvErGed anD met at ThE city; AbaNDoneD by Its inHABiTantS, ancarA wAS raZed to thE GRound, beforE The arAb aRMiEs Went oN to BeSiege and deSTroy AmOrium REacHinG As FaR as smyRNa. iN 859, eMpEror MichAeL iii (r. 842–867) CamE To thE cITy during a cAMPaIGN agaInst the araBs, And orDered its ForTIficAtionS Restored. IN 872, the citY WAs menacEd, but not taken, By ThE PaUlIcIans under CHrysocheiR. tHe lAst arab rAiD TO reach tHe cITY was undeRtaken in 931, by the aBbasId GOverNOr of tARSus, thAmal al-duLaFi, but the cItY agAiN wAs not capTuRed.