It is customary to recite Ana and the Yag Midot (the thirteen divine attributes of mercy) after the Amida prayer during Minha. Some have the practice of reciting Nefilat Apayim (Le’David and Abinu Malkenu), as well. It occasionally happens that a congregation begins reciting Minha 15-20 minutes or so before sundown, such that the sun has set by the time they complete the Hazan’s repetition of the Amida. The question arises as to whether they may still recite the Yag Midot and Nefilat Apayim at that point, or if these prayers may not be recited after sunset.
The Ben Ish Hai (Rav Yosef Haim of Baghdad, 1833-1909), in Parashat Ki Tisa, rules that a congregation may still recite the Yag Midot and Nefilat Apayim after sundown, until the time which he calls "Keri’at Ha’mugrab," or approximately seven minutes after sunset. Hacham Ovadia Yosef wonders why the Ben Ish Hai restricted the time frame to such an extent. If we allow reciting these prayers after sundown, the Hacham argued, then we should allow the recitations until the end of the entire period of Ben Ha’shemashot ("twilight," the period between sunset and nightfall). Hacham Ovadia thus ruled that one may recite Ana, the Yag Midot and Nefilat Apayim throughout the period of Ben Ha’shemashot, which extends for 13.5 minutes after sunset, and this is, indeed, the accepted Halacha.
Summary: If a congregation concludes the Hazan’s repetition of the Amida of Minha after sunset, they may still recite Ana, the Yag Midot and Nefilat Apayim, so long as it is still within 13.5 minutes of sunset.