During a feast, King Belshazzar of Babylon ordered the usage of vessels that were seized from the Temple in Jerusalem and then engaged in idolatry. The King then saw a hand write on a palace wall and became afraid. Belshazzar offered power as Babylon's third co-ruler to anyone who could interpret the writing, but none of his men could.
Belshazzar's mother then suggested having the prophet Daniel, who had served Belshazzar's ancestor Nebuchadnezzar, interpret the words.
O king, live forever! Do not be alarmed at your thoughts or let your face be changed. There is a man in your kingdom in whom is a spirit of the holy gods; and in the days of your father, illumination, understanding and wisdom like the wisdom of the gods were found in him. And King Nebuchadnezzar, your father—your father the king, appointed him chief of the magicians, enchanters, Chaldeans and diviners. It was because an extraordinary spirit, knowledge and insight, the ability to interpret dreams, clarify riddles, and solve complex problems were found in this Daniel, whom the king named Belteshazzar. Now let Daniel be called and he will give the interpretation.— Daniel 5:10–5:12 (AMP)
Daniel was brought before Belshazzar. Daniel did not seek the rewards that Belshazzar offered him, but he interpreted the writing nonetheless. Daniel told Belshazzar about Nebuchadnezzar: how God made Nebuchadnezzar a great king, how arrogance caused Nebuchadnezzar to lose his position, and how Nebuchadnezzar lived like an animal until he fully acknowledged God.
Daniel stated that Belshazzar sinned greatly and failed to acknowledged God. Daniel then told Belshazzar the meaning of the inscription:
And you, his [Nebuchadnezzar's] son, O Belshazzar, have not humbled your heart (mind), even though you knew all this. And you have exalted yourself against the Lord of heaven, and the vessels of His house have been brought before you, and you and your nobles, your wives and your concubines have been drinking wine from them; and you have praised the gods of silver and gold, of bronze, iron, wood and stone, which do not see or hear or understand. But the God who holds in His hand your breath of life and your ways you have not honored and glorified [but have dishonored and defied]. Then the hand was sent from the presence [of the Most High God], and this inscription was written:
This is the inscription that was written,mene, mene, tekel, upharsin [numbered, numbered, weighed, and divided].This is the interpretation of the message:mene—God has numbered the days of your kingdom and put an end to it;tekel—you have been weighed on the scales [of righteousness] and found deficient;peresyour kingdom has been divided and given over to the Medes and Persians.— Daniel 5:22–5:28 (AMP)
Belshazzar tried making Daniel co-ruler, but that same night, the Persians invaded, slew Belshazzar, and conquered Babylon, as prophesied.