CAIRO — Millions of Muslims paid respects at ancestral graves, shared festive family meals, and visited beaches and amusement parks Thursday to mark the end of the fasting month of Ramadan, but violence and political tension overshadowed holiday joy in hotspots like Egypt, Yemen, and Afghanistan.
The three-day Eid al-Fitr holiday, which caps Ramadan, also highlighted the long-running divide between Sunni and Shi’ite Muslims.
Many Sunnis began celebrating Thursday, while Shi’ites were to mark the holiday Friday, based on different views about sighting the moon.
In recent months, sectarian tensions have risen between Sunnis and Shi’ites, with the two sides increasingly lined up on opposite sides of Syria’s civil war.
In Egypt, where rival political camps have been facing off since the military ousted President Mohammed Morsi last month, worshiper Medhat Abdel Moneam said he doesn’t like to see Muslims quarreling.
‘‘Today is Eid,” he said, “and the Egyptian people are divided into two sides, two different thoughts, and it’s a shame because both sides are Muslims.’’
Morsi supporters, camped out at two other sites in Cairo, said they will not give up until Morsi is reinstated.
‘‘Whoever thought that the revolution would come to an end once Ramadan is over was wrong,’’ said Mohammed el-Beltagy, a top Muslim Brotherhood figure.
In northern Iraq, police closed many streets in the mainly Sunni city of Mosul to prevent car bombs during the holiday. Bombings are part of Iraq’s ongoing sectarian strife, and violence has picked up in recent months.
In tent camps that have sprung up in neighboring countries, Syrian refugees marked the holiday with a mix of hope and despair.
‘‘We wish in this Eid that God liberates Syria and to return safely to our country,’’ said Ibrahim Ismail, a refugee from Damascus.
Yet, he said, ‘‘we feel truly sad because we are not at home, we are displaced.’’