Magog is the name of the second son of Japheth, who was one of the three sons of Noah in the Bible (Genesis 10:1-2; I Chronicles 1:4-5). The term "Magog" is also used to refer to the nation that descended from Magog. Ezekiel 38 makes mention of the "land of Magog," which presumably refers to the land where the descendants of Magog settled after the nations dispersed from the Tower of Babel (Genesis 10).
According to Josephus, a well-known Jewish historian of the first century, the descendants of Magog were the Scythians (Antiquities of the Jews I, VI, 1). The Scythians were an ancient tribe that inhabited the region north of the Black Sea and north and east of the Caspian Sea.
Ezekiel 38-39 speaks of an individual called "Gog" that leads an invasion of Israel from the north. Gog is said to originate from "the land of Magog" (Ezekiel 38:2). This invasion is known to Biblical scholars as the Magog Invasion or the War of Gog and Magog.
Magog is mentioned along with Gog in Revelation 20:8 as a nation that comes against the "camp of the saints" and the "beloved city" at the end of a period of time known as the Millenium in Christian Eschatology. Gog and Magog are then destroyed by God with fire from heaven (Revelation 20:7-10).
The phrase "Gog and Magog" is also found in the Qur'an in sura Al-Kahf (The Cave chapter), 18:83-98, as "Yajuj and Majuj," and in 21:96-97.