According to the Book of Daniel, Daniel knew the meaning of the handwriting on the wall and read it to Belshazzar. The episode appears in Daniel chapter 5, during a royal feast in Babylon.
Belshazzar drinks from vessels taken from the Temple in Jerusalem when a mysterious hand writes “MENE, MENE, TEKEL, UPHARSIN” on the wall. The king's wise men cannot explain the message, but Daniel is brought before him. Daniel interprets it as a divine judgment: Belshazzar's days are numbered, he has been weighed and found wanting, and his kingdom will be divided and given to the Medes and Persians.
The phrase “the writing on the wall” later became an English idiom for an unmistakable warning of coming failure or disaster. The biblical story also differs from known history in several details. Belshazzar was historically the son of Nabonidus and never ruled as king in his own right, while the Book of Daniel presents him as king and identifies Nebuchadnezzar as his father.