Sahih Muslim 1902
The tradition has been narrated on the authority of 'Abdullah b. Qais. He heard it from his father who, while facing the enemy, reported that the Messenger of Allah (ﷺ) said:
Surely, the gates of Paradise are under the shadows of the swords. A man in a shabby condition got up and said; Abu Musa, did you hear the Messenger of Allah (ﷺ) say this? He said: Yes. (The narrator said): He returned to his friends and said: I greet you (a farewell greeting). Then he broke the sheath of his sword, threw it away, advanced with his (naked) sword towards the enemy and fought (them) with it until he was slain.
حَدَّثَنَا يَحْيَى بْنُ يَحْيَى التَّمِيمِيُّ، وَقُتَيْبَةُ بْنُ سَعِيدٍ، - وَاللَّفْظُ لِيَحْيَى - قَالَ قُتَيْبَةُ
 حَدَّثَنَا وَقَالَ، يَحْيَى أَخْبَرَنَا جَعْفَرُ بْنُ سُلَيْمَانَ، عَنْ أَبِي عِمْرَانَ الْجَوْنِيِّ، عَنْ أَبِي بَكْرِ بْنِ،
 عَبْدِ اللَّهِ بْنِ قَيْسٍ عَنْ أَبِيهِ، قَالَ سَمِعْتُ أَبِي وَهُوَ، بِحَضْرَةِ الْعَدُوِّ يَقُولُ قَالَ رَسُولُ اللَّهِ
 صلى الله عليه وسلم ‏
"‏ إِنَّ أَبْوَابَ الْجَنَّةِ تَحْتَ ظِلاَلِ السُّيُوفِ ‏"‏ ‏.‏ فَقَامَ رَجُلٌ رَثُّ الْهَيْئَةِ
 فَقَالَ يَا أَبَا مُوسَى آنْتَ سَمِعْتَ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ هَذَا قَالَ نَعَمْ ‏.‏
 قَالَ فَرَجَعَ إِلَى أَصْحَابِهِ فَقَالَ أَقْرَأُ عَلَيْكُمُ السَّلاَمَ ‏.‏ ثُمَّ كَسَرَ جَفْنَ سَيْفِهِ فَأَلْقَاهُ ثُمَّ مَشَى
 بِسَيْفِهِ إِلَى الْعَدُوِّ فَضَرَبَ بِهِ حَتَّى قُتِلَ ‏.‏