اعلم أن المؤرخين والنسابين اختلفوا في نسب البربر اختلافا كثيرا، وفي الاستقصى بعد ذكر أقوال في ذلك: وأشبه الأقوال بالصحة أن بني حام تنازعوا مع بني سام فانهزم بنو حام أمامهم إلى المغرب وتناسلوا به واتصلت شعوبهم من أرض مصر إلى آخر المغرب إلى تخوم السودان. وكان بسواحل المغرب الأفارقة والإفرنج فكانت ذرية حام في المداشر والخيام والأعاجم الأول في البلدان، وبقي أكثر أولاد حام في بلاد فلسطين من أرض الشام إلى زمن داود عليه السلام وكان ملكهم يسمى جالوت وآتاه الله الملك والحكمة وعلمه مما يشاء. أمر بإجلائهم عن بلاد كنعان وفلسطين إلى أرض المغرب فساروا نحو إفريقية وانتشروا هناك حتى ضاقت بهم البلاد وامتلأت منهم الجبال والكهوف والرمال وصاروا يتبعون مواقع القطر بالإبل وبيوت الشعر ولم تقدر الإفرنج على ردهم ودفاعهم فانحازت الأعاجم في المدن وبقي البربر فيما عداها وهم مع ذلك على أديان مختلفة يدين كل واحد منهم بما شاء من الأديان فمنهم من تمجس ومنهم من تهؤد ومنهم من تنصر، واستمر الحال على ذلك إلى زمن الإسلام وكان فيهم رؤساء وملوك وكهان، ولهم حروب وملاحم
Know that the historians and genealogists differed greatly about the lineage of the Berbers. In al-Istiqsa, after mentioning views on that: The view most resembling the truth is that the sons of Ham disputed with the sons of Sam, and the sons of Ham were routed before them to the Maghrib and multiplied there, and their peoples extended from the land of Egypt to the end of the Maghrib, to the borders of the Sudan. On the coasts of the Maghrib were the Afariqa and the Franks; the progeny of Ham were in the villages and tents, and the first non-Arabs in the towns. Most of the children of Ham remained in the land of Palestine, of the land of al-Sham, until the time of David, peace be upon him; their king was called Jalut, and God gave him kingship and wisdom and taught him of what He willed. He ordered them to be expelled from the lands of Canaan and Palestine to the land of the Maghrib, so they went toward Ifriqiya and spread there until the land became too narrow for them and the mountains, caves and sands were filled with them; they took to following the places where rain fell, with camels and tents of hair. The Franks were unable to repel and fend them off, so the non-Arabs withdrew into the towns and the Berbers remained in what was outside them. They were, with that, of different religions, each of them following whatever religion he wished: some of them became Magians, some became Jews and some became Christians. The situation continued thus until the time of Islam; they had chiefs, kings and soothsayers, and they had great wars and battles