section_path: Biography/Career/In Bukhara and Gurganj
section_name: In Bukhara and Gurganj
paragraph_text: In Bukhara and Gurganj
  
  At the age of seventeen, Avicenna was made a physician of Nuh II. By the time Avicenna was at least 21 years old, his father died. He was subsequently given an administrative post, possibly succeeding his father as the governor of Harmaytan. Avicenna later moved to Gurganj, the capital of Khwarazm, which he reports that he did due to "necessity". The date he went to the place is uncertain, as he reports that he served the Khwarazmshah, the ruler of Khwarazm, the Ma'munid ruler Abu al-Hasan Ali. The latter ruled from 997 to 1009, which indicates that Avicenna moved sometime during that period.
  
  He may have moved in 999, the year in which the Samanid Empire fell after the Kara-Khanid Khanate captured Bukhara and imprisoned the Samanid emir Abd al-Malik II. Due to his high position and strong connection with the Samanids, ibn Sina may have found himself in an unfavorable position after the fall of his suzerain.
  
  It was through the minister of Gurganj, Abu'l-Husayn as-Sahi, a patron of Greek sciences, that Avicenna entered into the service of Abu al-Hasan Ali. Under the Ma'munids, Gurganj became a centre of learning, attracting many prominent figures, such as ibn Sina and his former teacher Abu Sahl al-Masihi, the mathematician Abu Nasr Mansur, the physician ibn al-Khammar, and the philologist al-Tha'alibi.