Mastema is an arbiter angel who persecutes evil in Jewish mythology. He carries out punishments for God. He tempts humans and tests their faith. In the Zadokite Fragments and the Dead Sea Scrolls, he is the angel of disaster, the father of all evil, and a flatterer of God.
According to the Book of Jubilees, Mastema ("hostility") is the chief of the demons engendered by the Watchers/fallen angels with women. His actions and name indicate he is a Satan, an "Adversary", but more of a Satan who appears in the Book of Job with a function to fulfill under God than the Satan of later tradition who is the uttermost enemy of God. Belial, mentioned twice in Jubilees, is likely to be identical with Mastema in this work.
When God is ready to destroy all these demons after the flood and Noah prays that his descendants be released from their attacks, Mastema intervenes, beseeching God to allow him to retain and control one tenth of these demons in order to exercise his authority because they are "intended to corrupt and lead astray before my judgement because the evil of the sons of men is great". Mastema is the tester of humans, with God's permission.
After Mastema sent a plague of birds onto the land in the days of Terah, he later counsels God to test Abraham, just as Satan in the book of Job wants permission to test Job. As Abraham prepares to sacrifice his son Isaac, Mastema stands in God's presence. On his deathbed, Isaac promises that the spirits of Mastema will have no power to turn Jacob or his descendants away from God.