The prophecy concerning the "king of the North" and "king of the South" continues, but now it is the "time of the end", ie the last week of years.
"The king" of verse 36 is the "prince that shall come" in chapter 9:27, and the "little horn" of chapter 7:6 and 8:9-10, so he is the Antichrist, who assumes the position of "king of North, he is against God and prospers "till the wrath has been accomplished" that is, the wrath of God in the great tribulation, thus fulfilling God's plans.
The Antichrist will have no regard for religion and religious heritages, having as his "god" power and military activity. The "foreign god" that will help him is the "god of this world" (2 Corinthians 4:4 and Ephesians 2:2), the "dragon" (Revelation 13:2).
He will be attacked by the "king of the South", which must include Egypt and other countries allied with it, but the Antichrist will defeat them and, going through Israel, will take Egypt, Libya and Ethiopia (including Sudan). Jordan will escape.
Enraged by "news" (possibly news of riots) from the east and the north, he will return and install his headquarters near Jerusalem. There he will come to an end, and nobody can help him (as he will face Jesus Christ at His return, and be cast into the lake of fire and brimstone - Revelation 19:20, see also Zechariah 14).
At that time, ie, in the last three and a half years, there will be "a time of trouble, such as never was" (see Matthew 24:4-30), but Michael, the archangel, and supporter of Israel, will arise to rid the people of God, particularly Israel , from the charges of the dragon (Revelation 12:7-12).
As a result, "every one who is found written in the book," of the people of Israel will be miraculously saved (Revelation 7:1-8). Some will be raised from the dead to enter the Millennium with Christ (the wicked dead will be raised at the end of the Millennium (Revelation 20:5). Those tribulation saints who proved themselves wise by obeying the Lord and by leading others to faith and righteousness will be resplendent in eternal glory.
In an alternative interpretation, verse 2 of chapter 12 may refer to the resurrection of the nation, who was dead and buried among the nations, and now will live gloriously among them (Ezekiel 36:24-27, 37:11-22, Matthew 24:31, Romans 11:15,26), composed of those who are found righteous (by faith in Christ) and have eternal life. The others will find themselves under eternal condemnation. The wise men (faithful to God who reject the Antichrist) will be lights in the darkness, especially those who lead others to righteousness (by faith in Christ).
Daniel was told to "shut up the words, and seal the book until the time of the end." According to Matthew 13:10-15, the Lord Jesus explained that the Jews made themselves ignorant concerning the prophetic scriptures on purpose, and so He made use of parables. The veil is upon their hearts concerning the Old Testament, but when one of them turns to the Lord, the veil is removed (2 Corinthians 3:14-16). According to Revelation 22:10 "the time is near," and the prophetic mysteries are being unravelled from the time of Christ, many having already been fulfilled. Thus, "many shall run to and fro (or many shall scrutinize the book from end to end), and knowledge shall increase." This says that many of the Jews will study the prophetic Word and knowledge of it shall increase in the Great Tribulation.
Two other angels came and asked the One who Daniel fist saw, who was Christ Himself (10:5), when would these things happen, and He, swearing by God (no one else can do that), stated that it would be for three and a half years after the destruction of the power of the Jews (8:24).
Daniel did not understand and wanted to know what would be the end of it all, but He said that these words were "closed up", i.e. recorded and would remain "sealed", i.e. unchanged until the "time of the end": the vision will not be completely clear until it occurs. But he can be assured that the righteous will be purified, the wicked will manifest themselves as such, and only the wise will understand. The Lord mentions a period of days corresponding to one month after the end of last week with his coming (the time required for the conduct of all preceding judgements).
Those who survive another forty-five days are blessed (for they will participate in the millennium).
Daniel would die, but he received the promise of resurrection, "you will arise to your inheritance at the end of the days", ie, the second coming of Christ for His kingdom at the Millennium.
Dan 11:36 "Then the king shall do according to his own will: he shall exalt and magnify himself above every god, shall speak blasphemies against the God of gods, and shall prosper till the wrath has been accomplished; for what has been determined shall be done.
Dan 11:37 He shall regard neither the God of his fathers nor the desire of women, nor regard any god; for he shall exalt himself above them all.
Dan 11:38 But in their place he shall honor a god of fortresses; and a god which his fathers did not know he shall honor with gold and silver, with precious stones and pleasant things.
Dan 11:39 Thus he shall act against the strongest fortresses with a foreign god, which he shall acknowledge, and advance its glory; and he shall cause them to rule over many, and divide the land for gain.
Dan 11:40 "At the time of the end the king of the South shall attack him; and the king of the North shall come against him like a whirlwind, with chariots, horsemen, and with many ships; and he shall enter the countries, overwhelm them, and pass through.
Dan 11:41 He shall also enter the Glorious Land, and many countries shall be overthrown; but these shall escape from his hand: Edom, Moab, and the prominent people of Ammon.
Dan 11:42 He shall stretch out his hand against the countries, and the land of Egypt shall not escape.
Dan 11:43 He shall have power over the treasures of gold and silver, and over all the precious things of Egypt; also the Libyans and Ethiopians shall follow at his heels.
Dan 11:44 But news from the east and the north shall trouble him; therefore he shall go out with great fury to destroy and annihilate many.
Dan 11:45 And he shall plant the tents of his palace between the seas and the glorious holy mountain; yet he shall come to his end, and no one will help him.
Dan 12:1 "At that time Michael shall stand up, The great prince who stands watch over the sons of your people; And there shall be a time of trouble, Such as never was since there was a nation, Even to that time. And at that time your people shall be delivered, Every one who is found written in the book.
Dan 12:2 And many of those who sleep in the dust of the earth shall awake, Some to everlasting life, Some to shame and everlasting contempt.
Dan 12:3 Those who are wise shall shine Like the brightness of the firmament, And those who turn many to righteousness Like the stars forever and ever.
Dan 12:4 "But you, Daniel, shut up the words, and seal the book until the time of the end; many shall run to and fro, and knowledge shall increase."
Dan 12:5 Then I, Daniel, looked; and there stood two others, one on this riverbank and the other on that riverbank.
Dan 12:6 And one said to the man clothed in linen, who was above the waters of the river, "How long shall the fulfillment of these wonders be?"
Dan 12:7 Then I heard the man clothed in linen, who was above the waters of the river, when he held up his right hand and his left hand to heaven, and swore by Him who lives forever, that it shall be for a time, times, and half a time; and when the power of the holy people has been completely shattered, all these things shall be finished.
Dan 12:8 Although I heard, I did not understand. Then I said, "My lord, what shall be the end of these things?"
Dan 12:9 And he said, "Go your way, Daniel, for the words are closed up and sealed till the time of the end.
Dan 12:10 Many shall be purified, made white, and refined, but the wicked shall do wickedly; and none of the wicked shall understand, but the wise shall understand.
Dan 12:11 "And from the time that the daily sacrifice is taken away, and the abomination of desolation is set up, there shall be one thousand two hundred and ninety days.
Dan 12:12 Blessed is he who waits, and comes to the one thousand three hundred and thirty-five days.
Dan 12:13 "But you, go your way till the end; for you shall rest, and will arise to your inheritance at the end of the days.
Chapter 11 verse 36 to chapter 12 verse 13