Purim is the only feast found in the Old Testament that Jews celebrate which is not legislated by Mosaic law. The popular feast of Hanukkah is not found in the Old Testament, as it commemorates events that occurred more than two hundred years after the last Old Testament book was written around 400 B.C.
The reasons why Jews in Persia were threatened with slaughter and how Purim came to be considered a yearly period of rejoicing is found in the book of Esther.
Haman was an ambitious and egotistical man who greatly disliked the Jews. He became enraged when Mordecai, a Jewish official in the royal court, refuses in good conscience to bow before him and revere him as a god (verses 2 to 5).
Seeking to destroy not only Mordecai but all the Jews in the Kingdom, Haman casts lots (the Hebrew word for 'lots' is Pur or Purim and is where the feast gets its name) to determine which day to begin carrying out his plot. He then persuades King Xeres (Ahasuerus), through lies and offering 10,000 talents of silver (worth around $180 million today), to issue an edict ordering all Jews be killed (Esther 3:8 - 11).
Haman's plot is ultimately thwarted through the efforts of Mordecai and Queen Esther (who were cousins). Not only is he hanged on the same gallows he planned to use for Mordecai (Esther 7:10), his ten sons are also hung as well (9:13 -14). It is this event that Purim commemorates.
A tomb some believe hold the remains of Esther and Mordecai is located in Hamadan, a city in the Northwest part of modern day Iran. Ironically, even though the book of Esther delineates the Eternal's miraculous hand at saving the entire Jewish nation from slaughter, and the origination of Purim, the word 'God' is not found in the book.