Evening Prayer Revisited
There is a dispute in Tamud Bavli (Brachot 4b) as to whether one should say Shma with Brachot before or after Shmone Esre during the evening prayer. The opinion of R. Yohanan is that Shma is said first while the opinion of R. Yehoshua ben Levi is that Shmone Esre is said before the Shma. Moreover, while R. Yohanan holds that Shma is followed by Shmone Esre immediately, according to R. Yehoshua ben Levi Shmone Esre can be recited separately and Shma with its blessings does not have to follow immediately after. The practice of all Jews today is to follow R. Yochanan.
Most Rishonim and the Shulchan Aruch rule like R. Yohanan and indeed this seems to be the opinion of the Babylonian Talmud. This is called being “Somech Geula leTefila”, meaning the blessing of Gaal Yisrael (Who Redeemed Israel) is recited immediately before the Shmone Esre. At first sight it seems that the last blessing after evening Shma (Hashkivenu – let us go to sleep) only makes sense according to R. Yehoshua ben Levi. Indeed, Talmud Bavli (ibid) asks how the blessing of Hashkivenu would not be considered an interruption between Geula and Tefila according to R. Yochanan? It answers that it is considered “long Geula” (or continuation of the Geula). Our thesis is that in Palestine in Talmudic times, the opinion of R. Yehoshua ben Levi was the more accepted shita and moreover that they used to say Hashkivenu as the last blessing before going to sleep (as we say Hamapil).
Rashi (Brachot 2a) brings in the name of Talmud Yerushlami: Why do we say Shma in the synagogue in the evening, even though this is done before the earliest time to fulfil the obligation? It answers that we do this כדי לעמוד בתפלה מתוך דברי תורה
While it seems from Rashi that they said Shma with the blessings before Shmone Esre, the Tosafot (ibid) in the name of R. Tam says that they used to simply recite Shma without blessings before Maariv, just like we say Ashre before Mincha. Later on they would say Shma with the blessings following R. Yehoshua ben Levi. Indeed the sugia further in the same Yerushalmi (1:1) supports this interpretation entirely:
מילתיה אמרה שאין אמר דברים אחר אמת ויציב מילתיה דרבי שמואל בר נחמני אמר כן רבי שמואל בר נחמני כד הוה נחית לעיבורה הוה מקבל רבי יעקב גרוסה והוה רבי זעירא מטמר ביני קופייא משמענא היך הוה קרי שמע והוה קרי וחזר וקרי עד דהו' שקע מיניה גו שינתיה ומאי טעמא רבי אחא ור' תחליפא חמוי בשם רבי שמואל בר נחמן רגזו ואל תחטאו אמרו בלבבכם על משכבכם ודומו סלה מילתיה דר' יהושע בן לוי פליגא דרבי יהושע בן לוי קרי מזמורים בתרה …
It discusses if it’s permitted to speak after one already said the blessings after evening Shma. It mentions R. Yakov Grosa used to not speak after he said Shma with blessings, and then mentions R. Yehoshua ben Levi who used to still say various psalms afterwards.
From the Yerushalmi it seems that most people used to say Shmone Esre during the daytime, and later ate their meal and laid down to sleep saying the evening Shma with blessings.
We can also explain from here how the shita of Bet Shamai regarding saying evening Shma while laying down could have developed. It is unlikely that Shma in the evening was pronounced in normal position and then in some generation Bet Shamai suddenly ruled that one has to literally lie down to say it. A more likely scenario is that it was the norm to recite the evening Shma while lying down and the dispute of Bet Hillel and Bet Shamai arose as to whether this is the requirement or is merely done for convenience so as to not interrupt and fall asleep immediately.
Another obscure shita we can now explain is in Zohar Hadash (Bereshit 17d in Mosad HaRav Kook edition). It mentions that the idea of praying with “redness of the sun” applies to Maariv, not Mincha like our Talmud (Brachot 29b). In light of the shita of R. Yeshoshua ben Levi we can understand this. It seems the ideal time for Maariv according to this was around sundown. However one cannot fulfill the mitzvah of Shma at this time. It is also interesting that in Tosefta (Brachot, 3:2) the opinion of R. Yossi is mentioned that Maariv should be recited at the time of “Neilat Shearim”.
In conclusion, it seems that there were some communities where the norm was to recite Shmone Esre of the evening prayer before Shma with blessings, and these communities apparently recited the last blessing of Shma (Hashkivenu) in place of our Hamapil.
 I am currently unaware of any Rishon that paskened not like R. Yohanan, however the Meiri writes that “majority” pasken like R. Yohanan, so there must have been some who did not.
 Indeed Yerushlami does not mention the blessing of Hamapil, but it seems they used to say Hashkiveinu as the last Bracha and fall asleep afterwards. It’s interesting that our siddurim added Hashkivenu without Hatima at the Seder of going to sleep even though in reality for us this brocha is not necessary since we have Hamapil.
 It was normal to say the evening Shmone Esre in Eretz Yisrael during day time, before stars come out (possibly because of the danger to go outside at night as their synagogues were outside of the city).
 As many do today when praying early Maariv.
 See also Rosh (Brachot 1:1) and Korban Netaniel (10).
 See the commentaries from Baal Sefer Haredim and R. Chaim Kanievky. It’s possible that Rashi did not see this whole sugia in Yerushlami but only saw a quote of it in a Gaonic source. In general regarding use of Yerushalmi in Rashi, see Saul Lieberman’s letter to Solomon Zeitlin published at the end of Saul Lieberman and the Orthodox by R. Marc Shapiro, see also the discussion from Homat Yerushalaim printed in the beginning of standard Yerushalmi editions.
 The Yerushalmi calls the blessing after “Emet Veyatziv” as this was their Nusach, but our Nusach in the evening is “Emet Veemuna”.
 Of course R. Yehoshua ben Levi followed his own shita and said Shma with Brachot after Shmone Esre. Note that the same sugia before in Yerushalmi also discusses whether it’s permitted to speak after “Emet Veyatziv”. It continues with והא תני אין אומר דברים אחד אמת ויציב פתר לה באמת ויציב של שחרית.
 This is mentioned in our Talmud (Shevuot 16b) as well.
 And the prohibition of eating before Shma did not apply since they read Shma already even though they did not fulfill their obligation or because they were eating before the time of Shma arrived.
 For those who did not immediately go to sleep, the Yerushalmi (ibid) indeed mentions that they should recite Shma (with blessings) before midnight.
 Interestingly even at later times when many communities had a custom to say the evening prayer early, some people recited Shma without Brachot. R. Hai Gaon (Tshuvot Hagaonim Hahadashot – Emanuel, 93; this tshuva is brought in Rosh 1:1 and Bet Yosef 235) suggests that the one who is found in such a congregation should only say Shma without blessings and pray Shmone Esre together with them, but later one say Shma with Brachot.
 Indeed the Talmud there states that in Palestine they cursed the one who prays Mincha so close to sundown as it may lead to missing the time. Obviously this does not apply to Maariv for which there is plenty of time afterwards.