The Rama (Orach Chaim 233:1) rules that one who davens Mincha after Sheki’ah (sunset) until Tzeit HaKochavim (dusk) has fulfilled his obligation. The Sha’agat Aryeh (number 17) vigorously supports this view arguing that Rashi (Berachot 26a s.v. Ad HaErev) and Tosafot (Berachot 2a s.v. Mei’eimatai) maintain this view. However, the Mishna Berura (233:14) notes that many Poskim disagree with this view. Most prominently, the Talmidei Rabbeinu Yonah (Berachot 18a in the pages of the Rif s.v. Tefillat HaErev) and the Vilna Gaon (O.C. 261:2) rule that we may not daven Mincha after Sheki’ah. The source of this dispute is the statement of the majority opinion in the Mishnah which permits davening Mincha “Ad HaErev” (until the evening) which may be interpreted as being either sunset or dusk.
The Mishna Berura rules that one should make all efforts to accommodate the strict opinion, which he explains requires completing Mincha before Mincha. Moreover, he rules that it is preferable to daven Mincha without a Minyan before Sheki’ah than to daven Mincha with a Minyan after sunset.
We should add two caveats to this ruling of the Mishna Berurah. Rav Yosef Dov Soloveitchik (Shiurim L’Zecher Abba Mori Z”L) notes that the lenient opinion would concede that one may not daven Mincha after sunset on Erev Shabbat and Erev Yom Tov. Once one has accepted Shabbat (or Yom Tov) it is forbidden to daven a weekday prayer, as stated in the Shulchan Aruch (O.C. 263:15). Moreover, the Mishna Berurah presents the lenient opinion as applying “to us who daven Ma’ariv only after dusk”. Accordingly, those communities who regularly daven Ma’ariv after Sheki’ah should not daven Mincha after Sheki’ah even according to the Rama.