One night, King Nebuchadnezzar has a disturbing dream. It's so bad, that he's not able to get any sleep thereafter.
He calls in his Babylonian magicians and enchanters and asks them for help, but he refuses to tell them (quite unreasonably) what the dream actually was. They need to both tell him the dream he had and interpret it. He says that if they fail to come through, he's going to tear them "limb from limb" and lay their houses "in ruins." But if someone can tell him the dream and interpret it, they'll get showered with riches and rewards.
Sensibly, the wise men ask a second time for Nebuchadnezzar to tell them the dream so they can interpret it. The king says they're just trying to buy time, and they reply that no one can satisfy his insane demand, except for the gods. The king orders them all to be put to death.
Calling in the A-Team
Daniel and his friends are also arrested and slated to be executed—even though they apparently weren't present when the king had his initial freak-out and ordered every one dead. So, they don't know what's going on.
Daniel asks the king's head executioner Arioch why the king's death decree is falling on everyone so suddenly and without warning? Arioch fills him in on the situation.
So Daniel goes into Nebuchadnezzar and asks for a little time to discover the dream and relay the interpretation. Nebby agrees.
Daniel goes and tells Shadrach, Meshach, and Abednego to ask God for help, and their prayers are effective. During the night, Daniel has a vision which reveals the dream and its interpretation.
Clearly relieved and happy, Daniel sings a song of praise to God, citing God's supreme power and knowledge, his control over even the destiny of kings. He thanks God for rescuing him from his scrape with death.
He goes to Arioch and tells him not to kill the wise men—the day is about to be saved.
Smashing a Statue
Daniel is brought in before Nebuchadnezzar. When Nebuchadnezzar asks Daniel if he's able to help, Daniel gives all the credit to God, and says that all the wise men and enchanters are incapable of revealing these kinds of mysteries. He says that God gave Nebuchadnezzar his dream to show him what the future has in store.
Finally, Daniel launches into the actual description of the dream and its interpretation: King Nebuchadnezzar saw a giant, frightening statue of a human being—one with a head of gold, a chest and arms of silver, a stomach and thighs of bronze, lower legs made of iron, and feet made of mixed iron and clay.
Suddenly, he sees a stone—one not made by human hands—hit the statue on its weak part-clay, part-iron feet. The statue collapses into pieces and gets blown away by the wind. But the stone turns into a giant mountain that covers the entire earth.
Like a Rolling Stone
Daniel goes on to interpret the dream: King Nebuchadnezzar is the head of gold, the silver part of the statue is an inferior kingdom that will replace him, and the bronze part is a third kingdom that will "rule over the whole earth." The iron kingdom will be one that "crushes and smashes everything." The kingdom will get divided, symbolized by the clay and iron feet. It will be partly strong and partly fragile.
The stone thrown at the statue symbolizes the kingdom of God, which will utterly annihilate all these other kingdoms and permanently replace them, standing for all time.
Nebuchadnezzar is really impressed by this interpretation, bows down and worships Daniel and orders grain and incense offered to him. He also praises Daniel's God, saying he's clearly the "God of gods" for allowing Daniel to solve the king's puzzling dream.
The king gives Daniel a huge promotion, making him ruler of the province of Babylon (sort of like the mayor or maybe the county commissioner) and chief of all the Babylonian wise men (who just escaped mass extermination).
Remembering his friends, Daniel gets Shadrach, Meshach, and Abednego cushy positions, helping him oversee the everyday business of Babylon.
Daniel remains a servant at the king's court until Babylon falls.