According to , during a drunken feast, King Belshazzar of Babylon takes sacred golden and silver vessels, which had been removed from the Jewish Temple in Jerusalem by his predecessor Nebuchadnezzar. Using these holy items, the King and his court praise 'the gods of gold and silver, brass, iron, wood, and stone'. Immediately, the disembodied fingers of a human hand appear and write on the wall of the royal palace the words מנא ,מנא, תקל, ופרסין (Mene, Mene, Tekel u-Pharsin). Although usually left untranslated in English translations of Daniel, these words are known Aramaic names of measures of currency: MENE, a mina, TEKEL, a spelling of shekel, PERES, half a mina.
Despite various inducements, none of the royal magicians or advisors could interpret the omen. The King sends for Daniel, an exiled Jew taken from Jerusalem, who had served in high office under Nebuchadnezzar. The meaning that Daniel decrypts from these words is based on passive verbs corresponding to the measure names. Rejecting offers of reward, Daniel warns the King of the folly of his arrogant blasphemy before reading the text (vs 25–28).
And this is the writing that was inscribed: MENE, MENE, TEKEL, and PARSIN. This is the interpretation of the matter: MENE (literally a "monetary toll"), God has numbered the days of your kingdom and brought it to an end; TEKEL (literally a "tokenary weight"), you have been weighed on the scales and found wanting; PERES (literally a "division" or "portion"), your kingdom is divided and given to the Medes and Persians. (NRSV)
PARSIN is additionally a pun on the word for Persians.
The phrase the writing on the wall has come to signify a portent of doom—or the end of an organization or activity. To attribute to someone the ability to "read the writing on the wall" has come to signify the ability to foresee (not necessarily supernaturally) an inevitable decline and end.