Imam Ahmad recorded that Sa`d bin Malik said, "I said, `O Allah's Messenger, Allah has brought comfort to me today over the idolators, so grant me this sword.' He said,
«إِنَّ هَذَا السَّيْفَ لَا لَكَ وَلَا لِي، ضَعْه»
(This sword is neither yours nor mine; put it down.) So I put it down, but said to myself, `The Prophet might give this sword to another man who did not fight as fiercely as I did.' I heard a man calling me from behind and I said, `Has Allah revealed something in my case' The Prophet said,
«كُنْتَ سَأَلْتَنِي السَّيْفَ وَلَيْسَ هُوَ لِي، وَإِنَّهُ قَدْ وُهِبَ لِي، فَهُو لَك»
(You asked me to give you the sword, but it is not for me to decide about. However, it has been granted to me (by Allah), and I give it to you.) So Allah sent down this Ayah,
﴿يَسْأَلُونَكَ عَنِ الأَنفَالِ قُلِ الأَنفَالُ لِلَّهِ وَالرَّسُولِ﴾
(They ask you about Al-Anfal. Say: "Al-Anfal are for Allah and the Messenger'').
Abu Dawud, At-Tirmidhi and An-Nasa'i collected this Hadith, At-Tirmidhi said, "Hasan Sahih''.