The Qarlughids were a tribe of Turkic origin that controlled Ghazni, lands of the Bamyan, the Kurram Valley (Ghazna, Banban, and Kurraman), and established a short-lived Muslim principality and dynasty that lasted between 1236 and 1266. The Qarlughids (or Karluk Turks) arrived from the north to settle in the regions of Hazarajat together with the armies of Muhammad II of Khwarezm, the Shah of Khwarezm.