The word of the LORD came to me: “Son of man, set your face toward Gog, of the land of Magog, the chief prince of Meshech and Tubal, and prophesy against him and say, Thus says the LORD GOD: “Behold, I am against you, O Gog, chief prince of Meshech and Tubal”.
(Ezekiel 38, 1-3)

Gog and Magog besiege the City of Saints. Their depiction with the hooked noses noted by Paul Meyer
Gog and Magog (in Hebrew: גּוֹג וּמָגוֹג Gog u-Magog) appear in the Jewish Bible and Islamic manuscripts as individuals, tribes or territories.
In Ezekiel 38, Gog is an individual and Magog is his land; in Genesis 10 Magog is a man, but no Gog is mentioned; and centuries later Jewish tradition has changed Ezekiel’s “Gog of Magog” to “Gog and Magog,” which is the form in which they appear in the Book of Revelation, although here they are identified as peoples rather than individuals.
Today these two terms have become popular in the theological, spiritual and political fields almost as a coded message of GOD revealed to Ezekiel, Daniel and John (in Revelation). The books that “reveal the secrets of the end of time” sell millions of copies, and the number of conferences each year that claim to reveal exactly how the Bible predicts today’s events increases.
Gog is the name of a leader of the land of Magog, the Prince of Meshech and Tubal, territories named after Noah’s nephews (Gen 10, 1-2). We cannot accurately identify these areas, but probably the Jews of Ezekiel’s time had never met these mysterious nations living beyond the boundaries of their known world.
Ezekiel foresaw the day when Meshech and Tubal would join two other northern powers – Gomer and Beth-togarmah – and the four would form an alliance with Persia, Cush and Put, which were three powers in the far south or southeast of the Promised Land (Ezekiel 38, 3-6). The number seven typically indicates completeness in the Holy Scriptures, so what we have here is a prophecy that the full number of nations beyond the borders of Israel will one day rise up against the people of GOD. Although the lust for money and power would motivate these nations, the hand of the LORD would work in their favor. He would raise up these nations in order to reveal His Holiness and greatness (vv. 7-23). In summary, GOD would defeat these powers to reveal to them that He alone is GOD.
The prophet said that this will happen after the restoration of Israel, when his people “dwell safely” (vv. 14). This means that the restoration of Israel to peace and security would not have been accomplished all at once, and that some peoples of the world would not have known the LORD at the beginning of this restoration.
Midrashic Writings
The Bar Kokhba’s anti-Roman uprising in the 2nd century A.D. looked to a human leader as the promised messiah, but after his failure the Jews began to conceive the messianic era in supernatural terms: first would come a forerunner, the Messiah ben Joseph, who would defeat the enemies of Israel, identified as Gog and Magog, to prepare the way for the Messiah ben David; then the dead would rise, the Divine judgment would be issued, and the righteous would be rewarded.
The aggadah, the homiletic, non-legalistic exegetical texts of the classical rabbinical literature of Judaism, treat Gog and Magog as two names for the same nation that will come against Israel in the final war. The rabbis did not associate them with any specific nation or territory beyond a location north of Israel, but the great Jewish scholar Rashi identified Christians as their allies and said that GOD would thwart their plan to kill all of Israel.
In Islam
In the Koran (Sūrat al-Kahf, XVIII, 83-98) it is told how the “He of the Two Horns“, (a figure perhaps identified with Alexander the Great) confronted Gog and Magog, entities carrying chaos, and defeated them, imprisoning them behind a copper wall. This barrier, part of the Koranic exegesis identifies it with the Great Wall of China, while another (including Ṭabarī and Bayḍāwī) opts for the mountains that rise between Armenia and Azerbaijan. One day, however, they will escape and rage all over the world, swallowing every food and water they find, until they exterminate all the inhabitants of the earth; then they will start throwing darts towards the sky, until GOD sends worms, which will penetrate through their noses and ears and devour them from the inside, killing them.
References
- Lust 1999b, pp. 373–374.
- Boring, Eugene M (1989). Revelation. Westminster John Knox. p. 209. ISBN 9780664237752.
- Mounce, Robert H (1998). The Book of Revelation. Eerdmans. ISBN 9780802825377.
- Bietenholz 1994, p. 123.
- Van Donzel & Schmidt 2010, pp. 57, fn 3.
- Lemma «Yādjūdj wa-Mādjūdj» (E. van Donzel e Claudia Ott), su: The Encyclopaedia of Islam, new edition.
- Qazwīnī, ʿAjāʾib al-makhlūqāt, ed. F. Wüstenfeld, Gottinga, 1849.
- Masʿūdī, Murūj al-dhahab, ed. Charles Pellat, 5 voll., I, p. 144.
- Castelnovi Michele, La persistenza del mito di Gog e Magog nella cartografia medievale e moderna, in Dalla mappa al GIS. Atti del Primo Seminario di Studi, Roma 5-6 marzo 2007, a cura di Carla Masetti, Genova, Brigati, 2008, pp. 185-196. ISBN 97-88-887822-52-6.