Judea was part of the Ptolemaic Kingdom of Egypt from 200 BCE when King Antiochus III the Great of Syria defeated King Ptolemy V Epiphanes of Egypt at the Battle of Panium. Judea became at that moment part of the Seleucid Empire of Syria. King Antiochus III the Great, wanting to conciliate his new Jewish subjects guaranteed their right to "live according to their ancestral customs" and to continue to practice their religion in the Temple of Jerusalem. However in 175 BCE, Antiochus IV Epiphanes, the son of Antiochus III invaded Judea, ostensibly at the request of the sons of Tobias. The Tobiads, who led the Hellenizing Jewish faction in Jerusalem, were expelled to Syria around 170 BCE when the high priest Onias and his pro-Egyptian faction wrested control from them. The exiled Tobiads lobbied Antiochus IV Epiphanes to recapture Jerusalem. As the ancient Jewish historian, Flavius Josephus, tells us "The king being thereto disposed beforehand, complied with them, and came upon the Jews with a great army, and took their city by force, and slew a great multitude of those that favored Ptolemy, and sent out his soldiers to plunder them without mercy. He also spoiled the temple, and put a stop to the constant practice of offering a daily sacrifice of expiation for three years and six months."
When the Second Temple in Jerusalem was looted and services stopped, Judaism was outlawed. In 167 BCE, Antiochus ordered an altar to Zeus erected in the Temple. He banned circumcision and ordered pigs to be sacrificed at the altar of the temple. Antiochus's actions provoked a large-scale revolt. Mattityahu, a Jewish priest, and his five sons Jochanan, Simeon, Eleazar, Jonathan, and Judah led a rebellion against Antiochus. Judah became known as Yehuda HaMakabi (which means "Judah the Hammer"). By 166 BCE, Mattathias had died, and Judah took his place as leader. By 165 BCE, the Jewish revolt against the Seleucid monarchy was successful. The Temple was liberated and new holy vessels were made. According to the Talmud, olive oil was needed for the menorah in the Temple, which was required to burn throughout the night, every night. The story goes that there was only enough oil to burn for one day, yet it burned for eight days, the time needed to prepare a fresh supply of oil for the menorah. An eight-day festival was declared by the Jewish sages to commemorate this miracle.