In the third year of Jehoiakim, king of Judah, Nebuchadnezzar of Babylon besieges Jerusalem. The Lord gives Jehoiakim into his hand, and the Babylonian king carries part of the vessels of God's house to the temple of his own god in the land of Shinar. He then orders Ashpenaz, his chief official, to choose from the royal family and the nobility some young men without blemish, handsome and quick to learn, to be taught the language and literature of the Chaldeans. They will receive food and wine from the king's table and enter his service after three years.
Among those chosen from Judah are Daniel, Hananiah, Mishael and Azariah, who are given Babylonian names: Belteshazzar, Shadrach, Meshach and Abednego. Daniel resolves not to defile himself with the king's food or wine and asks the chief official for permission. God gives Daniel favor and compassion in his eyes, though the official fears for his own head. Daniel then proposes a ten-day test of vegetables and water to the steward in charge of them, after which their appearance can be compared with that of the other young men.
After ten days the four look healthier and stronger than those who ate the king's food, and the steward lets them continue their diet. God gives them knowledge and skill in all literature and wisdom, and Daniel in particular understanding of visions and dreams. When the training ends, Nebuchadnezzar examines them and finds no one like them; in every matter of wisdom he finds them ten times better than the magicians and enchanters of his kingdom. The chapter notes that Daniel remained there until the first year of King Cyrus.