Sahih Muslim, Book 33, Hadith 218 (Muslim 4878)

It has been narrated on the authority of Sulaiman b. Yasar who said:

People dispersed from around Abu Huraira, and Natil, who was from the Syrians. said to him: O Shaikh, relate (to us) a tradition you have heard from the Messenger of Allah (ﷺ). He said: Yes. I heard the Messenger of Allah (ﷺ) say: The first of men (whose case) will be decided on the Day of Judgment will be a man who died as a martyr. He shall be brought (before the Judgment Seat). Allah will make him recount His blessings (i. e. the blessings which He had bestowed upon him) and he will recount them (and admit having enjoyed them in his life). (Then) will Allah say: What did you do (to requite these blessings)? He will say: I fought for Thee until I died as a martyr. Allah will say: You have told a lie. You fought that you might be called a" brave warrior". And you were called so. (Then) orders will be passed against him and he will be dragged with his face downward and cast into Hell. Then will be brought forward a man who acquired knowledge and imparted it (to others) and recited the Qur'an. He will be brought And Allah will make him recount His blessings and he will recount them (and admit having enjoyed them in his lifetime). Then will Allah ask: What did you do (to requite these blessings)? He will say: I acquired knowledge and disseminated it and recited the Qur'an seeking Thy pleasure. Allah will say: You have told a lie. You acquired knowledge so that you might be called" a scholar," and you recited the Qur'an so that it might be said:" He is a Qari" and such has been said. Then orders will be passed against him and he shall be dragged with his face downward and...