Sunan Ibn Majah #52 · The Book of the Sunnah

Sunan Ibn MajahIt was narrated from 'Abdullah bin 'Amr bin 'As that
Sunan Ibn Majah · The Book of the Sunnah
Sunan Ibn Majah · كتاب السنة
the Messenger of Allah (ﷺ) said: 'Allah will not take away knowledge by removing it from people (from their hearts). Rather He will take away knowledge by taking away the scholars, then when there are no scholars left, the people will take the ignorant as their leaders. They will be asked questions and they will issue verdicts without knowledge, thus they will go astray and lead others astray
حَدَّثَنَا أَبُو كُرَيْبٍ، مُحَمَّدُ بْنُ الْعَلاَءِ حَدَّثَنَا عَبْدُ اللَّهِ بْنُ إِدْرِيسَ، وَعَبْدَةُ، وَأَبُو مُعَاوِيَةَ وَعَبْدُ اللَّهِ بْنُ نُمَيْرٍ وَمُحَمَّدُ بْنُ بِشْرٍ ح وَحَدَّثَنَا سُوَيْدُ بْنُ سَعِيدٍ، حَدَّثَنَا عَلِيُّ بْنُ مُسْهِرٍ، وَمَالِكُ بْنُ أَنَسٍ، وَحَفْصُ بْنُ مَيْسَرَةَ، وَشُعَيْبُ بْنُ إِسْحَاقَ، عَنْ هِشَامِ بْنِ عُرْوَةَ، عَنْ أَبِيهِ، عَنْ عَبْدِ اللَّهِ بْنِ عَمْرِو بْنِ الْعَاصِ، أَنَّ رَسُولَ اللَّهِ ـ صلى الله عليه وسلم ـ قَالَ ‏
"‏ إِنَّ اللَّهَ لاَ يَقْبِضُ الْعِلْمَ انْتِزَاعًا يَنْتَزِعُهُ مِنَ النَّاسِ وَلَكِنْ يَقْبِضُ الْعِلْمَ بِقَبْضِ الْعُلَمَاءِ فَإِذَا لَمْ يُبْقِ عَالِمًا اتَّخَذَ النَّاسُ رُءُوسًا جُهَّالاً فَسُئِلُوا فَأَفْتَوْا بِغَيْرِ عِلْمٍ فَضَلُّوا وَأَضَلُّوا ‏"‏ ‏.‏
Reference : Sunan Ibn Majah 52