He was taken to Babylon with Daniel, Mishael and Azariah after the siege of Jerusalem (Daniel 1:3–7). His name was changed to Shadrach by the Chaldeans (Babylonians). He entered the king's service with his friends and became one of the wisest men in Babylon.
Later, because he would not worship the statue of Nebuchadnezzar II, he was thrown into the furnace with his friends. But they survived by praying to God, and "the fire in no way touched them or caused them pain or harm" (Daniel 3). Hananiah means "the Lord is gracious."