Sunan an-Nasa'i, Volume 1, Book 6, Hadith 517 (DarusSalam)

It was narrated from Abu Hurairah that the Prophet said: "If any one of you catches the first prostration of 'Asr prayer before the sun sets, let him complete his prayer, and if he catches up with the first prostration of Fajr prayer before the sub rises, let him complete his prayer."

أَخْبَرَنَا عَمْرُو بْنُ مَنْصُورٍ، قَالَ حَدَّثَنَا الْفَضْلُ بْنُ دُكَيْنٍ، قَالَ حَدَّثَنَا شَيْبَانُ، عَنْ يَحْيَى، عَنْ أَبِي سَلَمَةَ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ إِذَا أَدْرَكَ أَحَدُكُمْ أَوَّلَ سَجْدَةٍ مِنْ صَلاَةِ الْعَصْرِ قَبْلَ أَنْ تَغْرُبَ الشَّمْسُ فَلْيُتِمَّ صَلاَتَهُ وَإِذَا أَدْرَكَ أَوَّلَ سَجْدَةٍ مِنْ صَلاَةِ الصُّبْحِ قَبْلَ أَنْ تَطْلُعَ الشَّمْسُ فَلْيُتِمَّ صَلاَتَهُ ‏" ‏ ‏.‏

sunnah.com

also referenced under: Book 6, Hadith 521 (In-Book)