AP PHOTOS: Top Middle East photos from 2016

CAIRO (AP) — For the Middle East, Afghanistan and Pakistan, 2016 was a year of grueling warfare.

It saw the campaign against the Islamic State group gain momentum, with international coalitions or local forces pushing back their territory in Iraq, Syria and Libya. But the militants also lashed back. They carried carried out a spectacular truck bomb attack on a shopping mall complex in Iraq as people prepared for the Muslim holiday Eid. Their Egypt branch carried out a similarly brazen suicide attack at Cairo's main cathedral.

Operations to wrest the group from Mosul, their last major stronghold in Iraq, began in October. But the fight has bogged down in tough urban warfare. And in Syria, the fight against IS was eclipsed by the brutal last days of the rebel-held enclave in Aleppo, which fell to government forces after weeks of siege.

Mercifully, 2016 also brought opportunities for people to gather for sacred days and in celebration of their daily lives.

Here is a selection of top 2016 photos from AP photographers across the region.