In Jewish eschatology Messiah ben Joseph or Mashiach ben Yoseph ( Māšīaḥ ben Yōsēf), also known as Mashiach bar/ben Ephraim (Aram./Heb.: Māšīaḥ bar/ben Efrayīm), is a name for a Jewish messiah, believed to be from the tribe of Ephraim and a descendant of Joseph. The figure's origins are much debated. Some regard it as a rabbinic invention, but others defend the view that its origins are in the Torah.D.C. Mitchell, Messiah ben Joseph (Newton Mearns: Campbell, 2016); 'Firstborn shor and rem: A Sacrificial Josephite Messiah in 1 Enoch 90.37-38 & Deuteronomy 33.17', Journal for the Study of the Pseudepigrapha 15.3 (2006) pp. 211-28.

Messianic tradition Jewish tradition alludes to four messianic figures, called the Four Craftsmen, from a vision found in the Book of Zechariah. The four craftsmen are discussed in the Babylonian Talmud. Hana bar Bizna, attributed to Simeon the Just, identifies these four craftsmen as Messiah ben David, Messiah ben Joseph, Elijah, and the Righteous Priest.Alan Avery-Peck The Review of Rabbinic Judaism: Ancient, Medieval, and Modern 9004144846 2005 "B. Suk. 52b: The Four Craftsmen "And the Lord showed me four craftsmen" (Zech. 2.3). ... Rav Hana bar Bizna said in the name of Rav Simeon Hasida: "Messiah ben David, Messiah ben Joseph, Elijah, and the Righteous Priest." " Each will be involved in ushering in the Messianic age.

Rashi's commentary on the Talmud gives more details. He explains that Messiah ben Joseph is called a craftsman because he will help rebuild the temple. Nahmanides also commented on Messiah ben Joseph's rebuilding of the temple. The roles of the Four Craftsmen are as follows. Elijah will be the herald of the eschaton."Elijah, Cup of." Encyclopedia Judaica. Jerusalem: Keter Publishing House, 1971. If necessary, Messiah ben Joseph will wage war against the evil forces and die in combat with the enemies of God and Israel.

According to Saadia Gaon the need for his appearance will depend on the spiritual condition of the Jewish people.

In the Apocalypse of Zerubbabel and later writings, after his death a period of great calamities will befall Israel. God will then resurrect the dead and usher in the messianic age of universal peace. Messiah ben David will reign as a king during the period when God will resurrect the dead. With the ascendancy of Rabbinic Judaism, the Righteous Priest has largely not been the subject of Jewish messianic speculation.

Sources in chronological order

The Dead Sea Scrolls While the Dead Sea Scrolls do not explicitly refer to a Messiah ben Joseph, a plethora of messianic figures are displayed.

The poly-messianic Testimonia text 4Q175 presents a prophet like Moses, a messianic figure and a priestly teacher. The Text contains four testimonia. The fourth testimonium is about Joshua and is generally viewed as non-messianic. However Alan Avery-Peck suggests that given its placement the text concerning Joshua should be read as referencing a war messiah from Ephraim. It is dated to the early 1st century BCE. 4Q372 (c. 200 BCE) features a suffering, 'Joseph' king-figure, who having sinned in setting up a competing Temple to that in Jerusalem, cries out to God in his death-throes as 'My father', citing the Psalms 89 and 22, and predicts that he will arise again to do justice and righteousness., Journal for the Study of the Pseudepigrapha 18.3: 181-205. 1QS lists a Messiah of Israel, a prophet and a priestly Messiah of Aaron. 1QS dates from around 100 BCE.

Gabriel's Revelation Gabriel's Revelation is a stone tablet with its text written in ink. Although the inscription is in a poor state of preservation, the meaning of the legible text is still a matter of scholarship.

The text seems to talk about a messianic figure from Ephraim who will break evil before righteousness by three days. Later the text talks about a "prince of princes" a leader of Israel who is killed by the evil king and not properly buried. The evil king is then miraculously defeated. The text seems to refer to Jeremiah Chapter 31. The choice of Ephraim as the lineage of the messianic figure described in the text seems to draw on passages in Jeremiah, Zechariah and Hosea. However, Matthias Henze suggests that this figure is not a reference to the Messiah ben Joseph who he believes is a later development but rather a pseudonym for the Messiah ben David and that Ephraim is simple a metonym in reference to Israel; Israel Knohl disagrees.

The text seems to be based on a Jewish revolt recorded by Josephus dating from 4 BCE. Both Josephus and Gabriel's Revelation describe three messianic leaders. Based on its dating, the text seems to refer to Simon of Peraea, one of the three leaders of this revolt.

Testaments of the Twelve Patriarchs The Testaments of the Twelve Patriarchs, thought by some to be a Christian writing or if Jewish to have had Christian influences. The Testaments of the Twelve Patriarchs is a composition of twelve texts one for each patriarch. The Testament of Benjamin was probably expanded later to include a reference to Messiah ben Joseph by Jewish sources. The Testament of Joseph on the other hand was probably altered by Christians to read that the virgin born Lamb of God from the tribe of Judah rather than the lamb son of Joseph would conquer.

Talmud In the Jerusalem Talmud Brachot 2:4, 5a an Arab tells a Jew that the messiah is born. His father's name is Hezekiah and he will be named Menahem. He is not referred to as the Messiah ben Joseph. However some have linked this passage to Messiah ben Joseph. Selling his cow and plough he buys some swaddling cloth and travels from town to town. He travels to Bethlehem where the child is born. All the women are buying their children clothing except Menahem's mother. She says her son is an enemy of Israel because he is born on the day the second temple was destroyed. He tells her that if she does not have money today she can pay later. He says that the child is surely the messiah who will rebuild the temple. When he returns she tells him that Menahem has been carried by a divine wind up to heaven. He will later return as Israel's messiah. In the Babylonian Talmud Sanhedrin 98b Menahem ben Hezekiah is also mentioned along with a list of other names of the messiah suggested by different rabbis. Again he is not referred to directly as the Messiah ben Joseph. Menahem's name translates as "the comforter". The Rabbis also called the messiah the leper scholar, using a pun related to a disciple of Rabbi Judah ha-Nasi who was smitten by leprosy. Babylonian Talmud Sukkah 52a records of a dispute between Rabbi Dosa ben Harkinas and other unnamed rabbis. Rabbi Dosa takes to apply to the mourning for Messiah ben Joseph, while the rabbis think the mourning is for the evil inclination. The talmudic redactor sides with Rabbi Dosa: the mourning is for Messiah ben Joseph. (Mourning the Evil Inclination, he adds, would be absurd.) It then speaks of how Ben Joseph's death frightens Messiah ben David, so that he urgently prays for his life to be spared. The Jerusalem Talmud Sukkah 5:2 also mentions Messiah ben Joseph. Babylonian Talmud Sukkah 52b presents the Four Craftsmen. Each may have a role to play in the ushering in the messianic age they are listed as Elijah, Messiah ben David, Righteous Priest and Messiah ben Joseph.

The Talmud uses the Hebrew ben rather than the Aramaic bar when giving the lineage of these messiahs, suggesting a date before 200 CE. Other parts of the passage are Aramaic confusing the matter. The similarity between 4Q175 and the Four Craftsman suggest that the Messiah ben Joseph probably existed in some form by the early 1st century BCE.

Targum Targumim were spoken paraphrases, explanations, and expansions of the Jewish scriptures that a Rabbi would give in the common language of the listeners.

The common Targum for is non-messianic. However, in the Jerusalem Targum to Zechariah 12.10, Messiah bar Ephraim is slain by Gog. In the Islamic era Targum Pseudo-Jonathan to Exodus 40.9-11, three messiahs Messiah ben David, Messiah ben Ephraim and Elijah are listed. Messiah ben Ephraim's death is not mentioned. The Targum on Song of Songs 4.5 compares Messiah ben David and Messiah ben Ephraim to Moses and Aaron. All of these Targumim refer to Messiah ben Ephraim rather than Messiah ben Joseph Dating of these Targumim is difficult. Dating earlier than the fourth century CE cannot be affirmed. The same is true for many of the Midrashim.

Sefer Zerubbabel Sefer Zerubbabel, also called the Book of Zerubbabel or the Apocalypse of Zerubbabel, is a medieval Hebrew apocalypse written at the beginning of the 7th century in the style of biblical visions (e.g. Daniel, Ezekiel) placed into the mouth of Zerubbabel. It narrates the struggle between Armilus and the Messiah whose name is Nehemiah ben Hushiel ben Ephraim ben Joseph. He will proceed Menahem ben Ammiel identified as the future Messiah ben David. Armilus is thought to be a cryptogram for Heraclius and the events described in the Sefer Zerubbabel coincide with the Jewish revolt against Heraclius. The Sefer Zerubbabel mentions Gog and Armilos rather than Gog and Magog as the enemies. In the Sefer Zerubbabel a celestial Temple is built in heaven and then lowered to earth.

Otot HaMashiah "Signs of the Messiah" Another medieval Hebrew apocalypse, the Otot HaMashiah or "Signs of the Messiah", also casts Nehemiah ben Hushiel as the Messiah ben Joseph. It gives a less historically linked account but is also thought to be dated to the beginning of the 7th century.

The following texts all mention Nehemiah as the Messiah ben Joseph. They are all similar to the Otot HaMashiah. The texts all contain ten signs of the coming of the Messiah. Nehemiah will confront Armilus with a Torah scroll in all of them. The texts are The Secrets of Rabbi Shimon ben Yohai and Ten Signs

The Secrets of Shimon bar Yohai Dated after the fall of the Umayyad Caliphate in the 8th century, the midrashic The Secrets of Rabbi Simon ben Yohai is generally positive towards Islam. Messiah ben Joseph will rebuild the temple but be killed in battle with Armilus. Armilus is described as bald having a leprous forehead and small eyes.

Midrash Messiah ben Joseph is established in the apocalypses of later centuries and the midrash literature.

Pesikta de-Rav Kahana 5:9 here the four craftsmen are listed as Elijah, the King Messiah, Melchizedek and the Anointed for War. Song of Songs Rabbah also lists the four craftsmen. Here they are listed as Elijah, the King Messiah, Melchizedek and the Anointed for War. Pesikta Rabbati 15.14/15 likewise the four craftsmen are listed as Elijah, the King Messiah, Melchizedek, and the Anointed for War. Pesikta Rabbati references an Ephraim Messiah rather than a Messiah ben Ephraim. It has been argued that this text may not refer to the Messiah ben Joseph but rather to the Messiah ben David. Genesis Rabbah In 75:6 the blessing on Joseph from Deuteronomy 33:17 is applied to the War Messiah later in 99:2 we are told that the War Messiah will be a descendant of Joseph. Pirkei De-Rabbi Eliezer, like the Apocalypse of Zerubbabel, refers to Menahem ben Ammiel. He is referred to as the son of Joseph. In others editions the name Menahem son of Ammiel son of Joseph is omitted and the text simple refers to the son of David. According to the Zohar and Apocalypse of Zerubbabel, Menahem is the Messiah ben David. The Pirke de-Rabbi Eliezer is often thought to have had Christian and Muslim influences. The text is often dated from the eighth or ninth century.