Both groups have been trying to raise their profile in Bangladesh by taking advantage of growing Islamist militancy there. They have co-opted or affiliated with home-grown jihadist groups. Al Qaeda has formed a branch -- al Qaeda in the Indian Subcontinent - which includes Bangladesh. And elsewhere in Asia, ISIS is trying to establish a growing presence as it comes under pressure in its heartland.
Late Saturday, ISIS released photographs of the alleged attackers and of the scene inside the café before Bangladeshi forces moved in. Photographs posted by ISIS-affiliated media outlet Amaq include gruesome scenes that appear to be from inside the café. The decor matches that of the Holey Artisan Bakery; the victims appear to have died from neck wounds -- which is consistent with what Bangladeshi authorities have reported about the scene.
The photographs of the attackers, smiling and holding their guns, were clearly taken before the assault -- suggesting at least co-ordination with ISIS in Iraq or Syria even if not proving direct operational control.
The assault was of a different nature and scale to anything claimed by ISIS in Bangladesh before. In the space of a few hours as many people were killed as had died in terror incidents in Bangladesh in the previous 18 months.
Al Qaeda responds
As if in answer to the ISIS statement, al Qaeda shot back Sunday with its own call to action. A message from the leader of al Qaeda in the Indian Subcontinent (AQIS), Asim Umar, was released on Sunday inciting Muslims to kill Hindu police and officials in India.
"Even if you come out carrying merely knives and swords then -- history bears witness -- Hindus cannot withstand you," he said in the Urdu-language audio.
AQIS has also begun publishing an online magazine called Resurgence that has called for attacks in Bangladesh, while al Qaeda leader Ayman al Zawahiri has called on Bangladeshi clerics to lead protests and encourage martyrdom.
Political divide fuels militancy
Bangladesh has seen growing Islamist militancy since 2013, in reaction to a crackdown by the secular government against the main Islamist party -- the Jamaat e Islami. Four of its leading figures have been executed
for crimes allegedly committed during Bangladesh's war of independence from Pakistan in 1971.
That militancy has led to the murders of secular bloggers and gay rights activists, as well as Hindu priests, over the past two years. Many of those attacks have been claimed by a group called Ansar al Islam, the Bangladesh part of AQIS.
By comparison, attacks attributed to ISIS sympathizers have targeted foreigners. In late 2015, ISIS claimed that its gunmen -- "Soldiers of the Caliphate in Bangladesh" -- were behind the murders of an Italian aid worker and Japanese citizen in Bangladesh.
Like those killings, the Dhaka attack appears to have been carried out by Bangladeshis. But it was far more ambitious and ISIS -- at some level - appears to have had foreknowledge of the plan. The sole surviving attacker may provide greater detail about that relationship, but equally the assailants may have been foot soldiers, with communication carried out at a higher level.
Government denies ISIS
The evidence of ISIS involvement runs counter to repeated claims by the government that there is no ISIS presence in Bangladesh. Prime Minister Sheikh Hasina Wajed said in February: "No (ISIS) exists in Bangladesh, but a few home-grown outfits in the name of Islam are conducting terrorist activities."
Analyst Animesh Roul says, "The threat picture is darkening, especially because Bangladesh's government has not acknowledged the presence of transnational groups."
Roul, who is director of the Society for the Study of Peace and Conflict in Delhi, says ISIS may be exploiting the presence in its ranks of dozens of Bengalis, including some from Britain.
In a report for Sentinel, the journal of West Point's Combating Terrorism Center, Roul says there's been a blitz of ISIS propaganda targeted at Bangladesh, including a eulogy in the most recent edition of its online magazine Dabiq for a fighter called Abu Jundal al-Banghali.
Focus turns to Asia
Additionally, eight Bangladeshi men were arrested in Singapore this year, allegedly for planning attacks in the name of the "Islamic State in Bangladesh." Investigators said they had already identified specific targets in their homeland. The eight were issued with two-year detention orders.
Roul concludes that "efforts by al Qaeda and the Islamic State to make Bangladesh the newest front of global jihad are creating a resonant jihadist wave that is energizing local groups to act."
ISIS has already shown signs of expanding its presence and operations in Asia
. It has a 'province' in Afghanistan (though has struggled to supplant al Qaeda and the Taliban), and has claimed attacks in the Philippines and Indonesia.
Just two weeks ago the 'Islamic State in the Philippines' released its first official video. It included statements from Filipino, Indonesian and Malaysian fighters in Syria inciting people in their home countries to carry out attacks.
A recent survey by the Institute for the Study of War suggested that "competition between militant elements vying to lead the Southeast Asian pro-ISIS movement will likely encourage increased jihadist attacks in the short term, threatening urban areas and Western interests in the region."
ISIS feeling the heat
As ISIS feels the pressure in its heartland, it may expand an already determined campaign to export its "brand" further afield, resorting to a more classic form of terrorism in a wide range of countries -- from Iraq, where weekend bombings claimed 126 lives, to Indonesia -- as the "caliphate'" itself shrinks. The attack last week at Istanbul airport is evidence of this pattern.
ISIS' chief spokesman and ideologue, Mohammed al Adnani, has tried to reframe how ISIS defines victory
. In an audio message at the end of May -- his first in seven months -- Adnani asked of the "crusaders": "Will we be defeated and you victorious if you took Mosul or Sirte or Raqqa or all the cities -- and we returned as we were in the beginning? No, defeat is losing the will and the desire to fight."
In the words of one Western counterterrorism official, "We can expect a metastasis of terror as it becomes increasingly difficult for ISIL [another acronym for ISIS] to hold on to core territories."