Aleinu (Hebrew: עָלֵינוּ, "it is our duty") or Aleinu leshabei'ach ("[it is] our duty to praise [God]"), meaning "it is upon us or it is our obligation or duty to praise God," is a Jewish prayer found in the siddur, the classical Jewish prayerbook. It is recited at the end of each of the three daily Jewish services. It is also recited following the New Moon blessing and after a circumcision is performed. It is second only to the Kaddish (counting all its forms) as the most frequently recited prayer in current synagogue liturgy.
A folkloric tradition attributes this prayer to the biblical Joshua at the time of his conquest of Jericho. This might have been inspired by the fact that the first letters of the first four verses spell, in reverse, Hoshea, which was the childhood name of Joshua (Numbers 13:16). Another attribution is to the Men of the Great Assembly, during the period of the Second Temple. An early—that is, pre-Christian—origin of the prayer is evidenced by its explicit mention of bowing and kneeling—practices associated with the Temple, and its non-mention of exile or a desire to restore Israel or the Temple. On the other hand, it has been argued that the phrase: "lirot meherah be-tiferet uzechah" (to speedily see your tiferet and oz) is in fact a request for the speedy rebuilding of the Temple. The allusion is based on Psalms 78:61 and 96:6. If so, at least the second paragraph of Aleinu was written after the destruction in 70 CE (perhaps around the time of Rav).
Its first appearance is the manuscript of the Rosh Hashana liturgy by the Talmudic sage Rav (Rabbi Abba Arikha, died 247), who lived in Babylonia (Persia). He included it in the Rosh Hashana mussaf service as a prologue to the Kingship portion of the Amidah. For that reason some attribute to Rav the authorship, or at least the revising, of Aleinu.
In Blois, France, in 1171, it is alleged that a number of Jews—reportedly 34 men and 17 women—were burned at the stake for refusing to renounce their faith. They are said to have gone to their deaths bravely singing Aleinu to a "soul-stirring" melody, which astonished their executioners. Some have suggested that this act of martyrdom inspired the adoption of Aleinu into the daily liturgy. But Aleinu is already found at the end of the daily shacharit in the Vitry Machzor in the early 12th century, well before 1171.