The term Moshiach unqualified always refers to Moshiach ben David (Moshiach the descendant of David) of the tribe of Judah. He is the actual (final) redeemer who shall rule in the Messianic age. All that was said in our text relates to him.
Moshiach ben Yosef (Moshiach the descendant of Joseph) of the tribe of Ephraim (son of Joseph), is also referred to as Moshiach ben Ephrayim, Moshiach the descendant of Ephraim.[2] He will come first, before the final redeemer, and later will serve as his viceroy.[3]
The essential task of Moshiach ben Yosef is to act as precursor to Moshiach ben David: he will prepare the world for the coming of the final redeemer. Different sources attribute to him different functions, some even charging him with tasks traditionally associated with Moshiach ben David (such as the ingathering of the exiles, the rebuilding of the Bet Hamikdash, and so forth).[4]
The principal and final function ascribed to Moshiach ben Yosef is of political and military nature. He shall wage war against the forces of evil that oppress Israel. More specifically, he will do battle against Edom, the descendants of Esau.[5] Edom is the comprehensive designation of the enemies of Israel,[6] and it will be crushed through the progeny of Joseph. Thus it was prophesied of old, “The House of Jacob will be a fire and the House of Joseph a flame, and the House of Esau for stubble..” (Obadiah 1:18): “the progeny of Esau shall be delivered only into the hands of the progeny of Joseph.”[7]
This ultimate confrontation between Joseph and Esau is alluded already in the very birth of Joseph when his mother Rachel exclaimed, “G‑d has taken away my disgrace” (Genesis 30:23): with prophetic vision she foresaw that an “anointed savior” will descend from Joseph and that he will remove the disgrace of Israel.[8] In this context she called his name “Yosef, saying ‘Yosef Hashem — may G‑d add to me ben acher (lit., another son), i.e., ben acharono shel olam — one who will be at the end of the world’s time,’[9] from which it follows that ‘meshu’ach milchamah — one anointed for battle’ will descend from Joseph.”[10]
The immediate results of this war[11] will be disastrous: Moshiach ben Yosef will be killed. This is described in the prophecy of Zechariah, who says of this tragedy that “they shall mourn him as one mourns for an only child.” (Zechariah 12:10).[12] His death will be followed by a period of great calamities. These new tribulations shall be the final test for Israel, and shortly thereafter Moshiach ben David shall come, avenge his death, resurrect him, and inaugurate the Messianic era of everlasting peace and bliss.[13]
This, in brief, is the general perception of the “second Moshiach,” the descendant of Joseph through the tribe of Ephraim.
Quite significantly, R. Saadiah Gaon (one of the few to elaborate on the role of Moshiach ben Yosef) notes that this sequence is not definite but contingent! Moshiach ben Yosef will not have to appear before Moshiach ben David, nor will the activities attributed to him or his death have to occur. All depends on the spiritual condition of the Jewish people at the time the redemption is to take place:
The essential function of Moshiach ben Yosef is to prepare Israel for the final redemption, to put them into the proper condition in order to clear the way for Moshiach ben David to come. Of that ultimate redemption it is said, that if Israel repent (return to G‑d) they shall be redeemed immediately (even before the predetermined date for Moshiach’s coming). If they will not repent and thus become dependent on the final date, “the Holy One, blessed be He, will set up a ruler over them, whose decrees shall be as cruel as Haman’s, thus causing Israel to repent, and thereby bringing them back to the right path.”[14] In other words, if Israel shall return to G‑d on their own and make themselves worthy of the redemption, there is no need for the trials and tribulations associated with the above account of events related to Moshiach ben Yosef. Moshiach ben David will come directly and redeem us.[15]
Moreover, even if there be a need for the earlier appearance of Moshiach ben Yosef, the consequences need not be as severe as described. Our present prayers and meritorious actions can mitigate these. R. Isaac Luria (Ari-zal) notes that the descendant of Joseph, by being the precursor of the ultimate Moshiach, is in effect kissey David, the “seat” or “throne” of David, i.e., of Moshiach. Thus when praying in the daily Amidah, “speedily establish the throne of Your servant David,” one should consider that this refers to Moshiach ben Yosef and beseech G‑d that he should not die in the Messianic struggle.[16] As all prayers, this one, too, will have its effect.
It follows, then, that all the above is not an essential or unavoidable part of the Messianic redemption that we await. Indeed, it — (and the same may be said of the climactic war of Gog and Magog) — may occur (or may have occured already!) in modified fashion.[17] This may explain why Rambam does not mention anything about Moshiach ben Yosef. R. Saadiah Gaon[18] and R. Hai Gaon,[19] as well as a good number of commentators, do refer to him briefly or at length. In view of the divergent Midrashim and interpretations on this subject it is practically impossible to present a more definitive synopsis that would go far beyond the above. Thus it is wisest to cite and follow R. Chasdai Crescas who states that “no certain knowledge can be derived from the interpretations of the prophecies about Moshiach ben Yosef, nor from the statements about him by some of the Geonim;” there is no point, therefore, in elaborating on the subject.[20]
Pirkei Heichalot Rabaty, ch. 39 (Batei Midrashot, ed. Wertheimer, vol. I) and Sefer Zerubavel (ibid., vol. II), offer his personal name as Nechemiah ben Chushiel (likewise in Midrash Tehilim 60:3), adding “who is of Ephraim the son of Joseph.” (Interestingly enough, Pirkei deR. Eliezer, ch. 19, calls him Menachem ben Ammi’el, the very name the other sources — and Zohar III:173b — attribute to Moshiach ben David.)
Targum Yehonathan on Exodus 40:11 traces his descent to Joshua (cf. below, note 7). Other sources state that he is a descendant of Yeravam ben Nevat, with practical implications in the Providential scheme for this genealogy; see Zohar Chadash, Balak:56b; commentary of R. Abraham Galante on Zohar II:120a (cited in Or Hachamah there); and Emek Hamelech, Sha’ar Olam Hatohu:ch. 46. Cf Devash Lefi, s.v. mem:par. 18. (Note also the sources cited in Sha’arei Zohar on Sukah 52a with regards to other views about his lineage.)
Interestingly enough, according to Pirkei deR. Eliezer ch. 28 (in non-censored versions), the Ishmaelites (Arabs) will be the final kingdom to be defeated by Moshiach. Other sources state “Edom and Ishmael” (see Torah Shelemah on Genesis 15:12, note 130). Note, however, Pirkei deR. Eliezer, ch. 44 (and cf. Midrash Tehilim 2:6 and 83:3) that Edom and Ishmael have become intermingled. See also Mayanei Hayeshu’ah, Mayan 11:8.
Moshiach ben Yosef’s battle against Edom is analogous to, and the culmination of, Israel’s first battle against Edom (Amalek) after the exodus from Egypt (Exodus 17:5ff.). In that first battle, the Jewish army was led by Joshua — who is also of the tribe of Ephraim, and (according to some) this Moshiach’s ancestor (see above note 2); see Ramban on Exodus 17:9, and R. Bachaya on Exodus 18:1. Cf. also R. Bachaya on Exodus 1:5, drawing an analogy between the role of Joseph in Egypt and the role of the Moshiach descended from him in the ultimate redemption.
In context of his military function, Moshiach ben Yosef is referred to as meshu’ach milchamah (cf. Sotah 42a, and Rashi on Deuteronomy 20:2, for this term); see Bereishit Rabba 75:6 and 99:2; Shir Rabba 2:13 (a parallel passage of Sukah 52b); and Agadat Bereishit, ch. (63) 64.
Moshiach ben Yosef (Moshiach the descendant of Joseph) of the tribe of Ephraim (son of Joseph), is also referred to as Moshiach ben Ephrayim, Moshiach the descendant of Ephraim.[2] He will come first, before the final redeemer, and later will serve as his viceroy.[3]
Pirkei Heichalot Rabaty, ch. 39 (Batei Midrashot, ed. Wertheimer, vol. I) and Sefer Zerubavel (ibid., vol. II), offer his personal name as Nechemiah ben Chushiel (likewise in Midrash Tehilim 60:3), adding “who is of Ephraim the son of Joseph.” (Interestingly enough, Pirkei deR. Eliezer, ch. 19, calls him Menachem ben Ammi’el, the very name the other sources — and Zohar III:173b — attribute to Moshiach ben David.)
Targum Yehonathan on Exodus 40:11 traces his descent to Joshua (cf. below, note 7). Other sources state that he is a descendant of Yeravam ben Nevat, with practical implications in the Providential scheme for this genealogy; see Zohar Chadash, Balak:56b; commentary of R. Abraham Galante on Zohar II:120a (cited in Or Hachamah there); and Emek Hamelech, Sha’ar Olam Hatohu:ch. 46. Cf Devash Lefi, s.v. mem:par. 18. (Note also the sources cited in Sha’arei Zohar on Sukah 52a with regards to other views about his lineage.)
Interestingly enough, according to Pirkei deR. Eliezer ch. 28 (in non-censored versions), the Ishmaelites (Arabs) will be the final kingdom to be defeated by Moshiach. Other sources state “Edom and Ishmael” (see Torah Shelemah on Genesis 15:12, note 130). Note, however, Pirkei deR. Eliezer, ch. 44 (and cf. Midrash Tehilim 2:6 and 83:3) that Edom and Ishmael have become intermingled. See also Mayanei Hayeshu’ah, Mayan 11:8.
Moshiach ben Yosef’s battle against Edom is analogous to, and the culmination of, Israel’s first battle against Edom (Amalek) after the exodus from Egypt (Exodus 17:5ff.). In that first battle, the Jewish army was led by Joshua — who is also of the tribe of Ephraim, and (according to some) this Moshiach’s ancestor (see above note 2); see Ramban on Exodus 17:9, and R. Bachaya on Exodus 18:1. Cf. also R. Bachaya on Exodus 1:5, drawing an analogy between the role of Joseph in Egypt and the role of the Moshiach descended from him in the ultimate redemption.
In context of his military function, Moshiach ben Yosef is referred to as meshu’ach milchamah (cf. Sotah 42a, and Rashi on Deuteronomy 20:2, for this term); see Bereishit Rabba 75:6 and 99:2; Shir Rabba 2:13 (a parallel passage of Sukah 52b); and Agadat Bereishit, ch. (63) 64.