If anyone says a rak'ah of the 'Asr prayer before sunset, he has observed (the 'Asr prayer), and if anyone performs a rak'ah of the Fajr prayer, he has observed (the Fajr prayer). (Using translation from Abū Dāʾūd 412)
أَنَّ رَسُولَ اللهِ ﷺ قَالَ «مَنْ أَدْرَكَ مِنْ صَلَاةِ الصُّبْحِ رَكْعَةً قَبْلَ أَنْ يَطْلُعَ قَرْنُ الشَّمْسِ الْأَوَّلِ فَقَدْ أَدْرَكَ وَمَنْ أَدْرَكَ مِنْ صَلَاةِ الْعَصْرِ رَكْعَةً أَوِ ثِنْتَيْنِ قَبْلَ أَنْ تَغْرُبَ الشَّمْسُ فَقَدْ أَدْرَكَ»