Ahead of Eid al-Adha, or the Feast of Sacrifice, Pakistani Muslims hold a cow at a livestock market in Quetta Sept. 22, 2015. Banaras Kan/AFP/Getty Images

Millions of Muslims around the world are gearing up to celebrate Eid al-Adha, the holiday marking the end of the annual hajj to the Saudi Arabian city of Mecca. Beginning Thursday, the Feast of Sacrifice lasts three to four days, and it is a public holiday in many Muslim countries.

Here’s everything you need to know about Eid al-Adha. The holiday commemorates the story of the Prophet Ibrahim (aka Abraham among Christians and Jews), who was willing to sacrifice his son Ismail (aka Ishmael) at God’s command. But when Ibrahim was on the verge of sacrificing Ismail, God spared the boy, replacing him with either a lamb or a ram.

Eid al-Adha is different from Eid al Fitr, which marks the end of the Muslim month of fasting, Ramadan, and takes place roughly two months earlier than Eid al-Adha. The Arabic word “Fitr” can be translated as the English phrase “breaking the fast.”

Eid al-Adha also marks the end of hajj, the pilgrimage to Mecca that able-bodied, devout Muslims are supposed to make at least once in their lifetimes as one of the five pillars of Islam. It starts the 10th day of the Islamic month of Dhu al-Hijjah, the final month on the Islamic calendar.

Because the Islamic calendar is based on the lunar cycle, it shifts forward 11 days every year against the Gregorian calendar, which is based on the solar cycle. Dates for Muslim holidays are frequently not finalized until shortly before they begin. It wasn’t until mid-September that Saudi Arabia’s moonsighting body declared Thursday as the starting date for Eid al-Adha this year -- earlier than had been expected.

During Eid al-Adha, Muslims with the financial means to do so can sacrifice an animal such as a sheep, goat or cow. They are supposed to eat one-third of the meat, share one-third with friends or neighbors and donate one-third to the needy. They also buy new clothes, exchange gifts and visit family, friends and neighbors.

A common dessert during both Eids is maamoul, crumbly cookies traditionally filled with chopped nuts or date paste (although modern spinoffs will incorporate other ingredients, such as Nutella), pressed into molds with intricate designs or looped into O’s like small donuts and dusted with powdered sugar.

A variety of greetings are appropriate during Eid. One of the most common is “Eid Mubarak,” or “Blessed Eid.” There is also “Kul ’am wa inta bekhair,” or “May every year see you in good health,” and “Eid Saeed,” or “Happy Eid.”