Abdullah bin Amr bin As reported,

One day, the Messenger of Allah ﷺ came out from one of his rooms and entered the mosque, where he found two circles of people. One group was reciting the Quran and supplicating to Allah, and the other was learning and teaching.The Prophet ﷺ said, "Both groups are engaged in good. These are reciting the Quran and supplicating to Allah, so if He wills, He will grant them, and if He wills, He will withhold from them. And these are learning and teaching, and I was sent only as a teacher."Then he sat down with them.

Ibn Majah 229

Daif

حدثنا بشر بن هلال الصواف حدثنا داود بن الزبرقان عن بكر بن خنيس عن عبد الرحمن بن زياد عن عبد الله بن يزيد

عن عبد الله بن عمرو قال

خرج رسول الله ﷺ ذات يوم من بعض حجره فدخل المسجد فإذا هو بحلقتين إحداهما يقرءون القرآن ويدعون الله والأخرى يتعلمون ويعلمون فقال النبي ﷺ كل على خير هؤلاء يقرءون القرآن ويدعون الله فإن شاء أعطاهم وإن شاء منعهم وهؤلاء يتعلمون وإنما بعثت معلما فجلس معهم

ابن ماجه 229ضعيف
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Sunnah
Chapter
Virtue of scholars and the encouragement to seek knowledge
Numbering
Darussalam 229
Ibn Majah 229