A person had 6 minutes left until sunset and thought it was enough time to perform the Dhuhr prayer and one Rak'ah of the Asr prayer (intending to perform). However, after raising their head from the second prostration in the first Rak'ah of the Asr prayer, they realized that sunset had occurred (they were only a few seconds late). They continued the Asr prayer with the intention of performing it. What is the ruling regarding both the Dhuhr and Asr prayers?