In the era of the Second Temple, (167 BCE) the Greek kingdom issued decrees against the Jewish people, to nullify their faith and refusing to allow them to observe the Torah and its commandments. They extended their hands against their property and their daughters; they entered the Sanctuary, wrought havoc within, and made the holy objects impure.
The Jews suffered great difficulties from them, for they oppressed them greatly until the God of our ancestors had mercy upon them, delivered them from their hand, and saved them. The sons of the Hasmoneans, the High Priests, overcame them and saved the Jews from their hands.
They appointed a king from the priests, and sovereignty returned to Israel for more than 200 years, until the destruction of the Second Temple.
When the Jews overcame their enemies and destroyed them, they entered the Sanctuary; this was on the twenty-fifth of Kislev. They could not find any pure oil in the Sanctuary, with the exception of a single cruse. It contained enough oil to burn for merely one day. They lit the arrangement of candles from it for eight days until they could crush olives and produce pure oil.
Accordingly, the Sages of that generation ordained that these eight days, which begin from the twenty-fifth of Kislev, should be commemorated to be days of happiness and praise of God. Candles should be lit in the evening at the entrance to the houses on each and every one of these eight nights to publicize and reveal the miracle.
These days are called Chanukah. It is forbidden to eulogize and fast on them, as on the days of Purim. Lighting the candles on these days is a Rabbinic mitzvah, like the reading of the Megillah.
Whoever is obligated to read the Megillah is also obligated to kindle the Chanukah lamp.4 On the first night, a person lighting [the lamp] recites three blessings. They are:
- Blessed are You, God, our Lord, King of the universe, who has sanctified us with His commandments and has commanded us to light the Chanukah lamp.
- "...who wrought miracles for our ancestors...."
- "...who has granted us life, sustained us...."
On subsequent nights, a person who kindles the chanukiyah should recite two blessings for the blessing Shehecheyanu is recited only on the first night.
On each and every one of these eight days, the entire Hallel is recited. Before [its recitation], one should recite the blessing "...who has sanctified us with His commandments and commanded us to complete the Hallel." This applies whether the recitation is individual or communal.
(Rambam Hilchot Megillah Chapter 3)