It is narrated from Sayyiduna Uqbah bin Amir al-Juhani (may Allah be pleased with him) that he said: "We were in the mosque learning the Qur'an when the Messenger of Allah (peace and blessings be upon him) came to us and greeted us with salam. We returned his (peace and blessings be upon him) greeting, and he (peace and blessings be upon him) said: 'Learn the Qur'an and acquire it (that is, safeguard it)'" and then the narrator mentioned the whole hadith.
This narration was recorded by Imam al-Harith bin Muhammad bin Abi Usamah. Imam Ibn Hibban also recorded it in his Sahih through al-Hasan bin Sufyan, Abu Bakr bin Abi Shaybah and Zayd bin al-Hubab, but without his (peace and blessings be upon him) words "and recite it with a beautiful voice". Imam al-Nasa'i also recorded it in his book 'al-Fada'il' through al-Qasim bin Zakariyya, by the route of Zayd bin al-Hubab.