It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) that he said: "The Messenger of Allah (peace and blessings be upon him) liked the Muhajirun and the Ansar to be close to him (peace and blessings be upon him) (in the rows of prayer), so that they could learn (the rulings of the religion) from him (peace and blessings be upon him) and memorise his (peace and blessings be upon him) sayings."
Imam al-Nasa'i (may Allah have mercy on him) narrated it in 'al-Manaqib' through Muhammad bin al-Muthanna from Khalid.
Imam Ibn Majah (may Allah have mercy on him) narrated it in 'al-Salah' through Nasr bin Ali from al-Thaqafi.
Abu Hatim bin Hibban al-Busti (may Allah have mercy on him) narrated it in his book from Muhammad bin Ahmad bin Abi Awn, from Bakr bin Khalaf, from Ibn Abi Adi; all of them narrated it through Humayd from Sayyiduna Anas (may Allah be pleased with him).
Imam Muslim (may Allah have mercy on him) recorded in his 'Sahih', in the narration of Sayyiduna Abu Mas'ud al-Ansari (may Allah be pleased with him), this saying of the Prophet (peace and blessings be upon him), that he (peace and blessings be upon him) said: "Let those of you who are mature and possess understanding be close to me."