In the first half of the 18th century, its then capital Birnin Zamfara, was destroyed by the Gobir Kingdom and a new capital was established in Anka by the second half of the 19th century. Zamfara had many centers of commerce and scholarship that attracted many scholars like the Yandoto city. It became part of the Sokoto Caliphate after the 1804 jihad by Usman dan Fodio. In fact, Usman Danfodiyo settled in Sabon Gari where Sarkin Zamfara Abarshi had already established a garrison headquarters during the early days of his Jihad as a base from where fought Gobir and Kabi.