In a world of cause and effect, the nightmare that unfolded in Dhaka on Friday night was entirely predictable.
Since the opposition-boycotted 2014 elections, the most violent in its history, Bangladesh has steadily descended into a cycle of polarising politics, pitting the avowedly secular nationalist government of Prime Minister Sheikh Hasina Wazed against the country's religious establishment, key allies of opposition leader Khaleda Zia.
With gusto, Sheikh Hasina has pursued the prosecution of leaders of the Jamaat-e-Islami, the country's biggest religious party, for their alleged involvement in massacres of at least 300,000 civilians during the 1971 war of independence with Pakistan, won after India intervened militarily.
Despite widely voiced concerns about the fairness of the trials conducted by the Bangladesh International Crimes Tribunal, established by Sheikh Hasina in 2009, four Jamaat-e-Islami leaders have been executed since December 2013 for war crimes.
Parallel to the war crimes trials, there has been a steady stream of murderous attacks by terrorists on prominent secular activists, foreign NGO workers and members of religious minorities.
Some were claimed by militants claiming to be part of the Islamic State in Iraq and the Levant (ISIL, also known as ISIS), while the responsibility for others has been assumed by the Ansarullah Bangla Team and Jamaat-ul-Mujahideen Bangladesh, affiliates of al-Qaeda.
READ MORE: The politics at play in Bangladesh war trials
On each occasion, however, the Bangladesh government has refused to accept that either of the global jihadi conglomerates were involved. Instead, the attacks have been dismissed by officials as the handiwork of local militants, painted as allies of the opposition amid plans to outlaw the Jamaat-e-Islami altogether.
Bangladesh's government has been creating a political vacuum at the same time as ISIL has reached out to struggling jihadi factions across South and Southeast Asia.
On both counts, the Awami League administration has been playing with fire, with scant consideration for the consequences.
The war crimes trials are a highly emotive subject. By prosecuting Jamaat-e-Islami leadership figures, Sheikh Hasina has fulfilled longstanding demands that justice be brought to bear against the perpetrators of the 1971 genocide.
The counterview is that the Awami League, by criminalising the Jamaat-e-Islami, is working towards the establishment of the one-party state envisioned by the founder of Bangladesh, Sheikh Mujibur Rahman, the late father of Sheikh Hasina.
Apparently, she is seeking to exclude political parties which have governed the country as often as the Awami League has from the democratic process.
Either way, Bangladesh's government has been creating a political vacuum at the same time as ISIL has reached out to struggling jihadi factions across South and Southeast Asia.
The ISIL outreach has sparked competition among sidelined and wannabe jihadis to prove themselves worthy of governorate status - and the money and power that comes with it - by staging outrageous attacks.
|Indian family members place floral tributes near the site of the terrorist attack in Dhaka, Bangladesh [EPA]
Some have been carried out by novices - such as the botched attack in Jakarta in January - while others have involved mature terrorist organisations such as Abu Sayyaf, responsible for an ongoing string of kidnappings in the southern Philippines.
The tactics employed by terrorists in Dhaka strongly suggest the involvement, at least in leadership roles, of hardened terrorists with significant overseas combat experience.
Seven men were involved, a common number for suicide-attack squads in Afghanistan and Pakistan where they are usually split into a few two-man teams supervised by an experienced commander.
It would be safe to assume that the attack involved one or more Bangladeshi terrorists from the several hundred who trained and fought alongside al-Qaeda and its affiliates in the Af-Pak arena between the late 1990s and the mid-2000s.
Switched loyalty to ISIL
Undoubtedly, some would have worked with al-Qaeda militants who have since switched loyalty to ISIL for the sake of empowerment and to feed the addiction to bloodshed that all terrorists acquire over a period of time.
ALSO WATCH: Bangladesh's new reality
Forced to lie low and impoverished by a lack of funding, such veteran killers are always plugged in to jihadi networks, hoping for an encrypted phone call to resurrect their careers.
Thus the government's argument that ISIL does not have a network in Bangladesh is irrelevant. In choosing to view the rising terrorism campaign through a domestic political prism, Sheikh Hasina is repeating the mistakes of the Pakistani counterparts she loathes.
When sectarian terrorism, similar to that ongoing in Bangladesh, first broke out in Pakistan in the late 1990s, the government narrative framed it as a proxy war fought on behalf of rival Middle Eastern actors. That state of denial confused public opinion and gave militants time and space to build the networks with which to launch a nationwide insurgency in 2007 that has since cost Pakistan dearly.
Sheikh Hasina is going to the other extreme by equating the opposition with the terrorists for political ends. Soon enough, she will discover that it does not take many militants to cause significant harm to Bangladesh's economy and her government.
They started with targeted murders, graduated to mass killings over the weekend, and will be looking to raise their profile further by attacking ruling party politicians and security forces personnel with improvised explosive devices.
The militants will also aim to use Bangladeshi territory to recruit disenfranchised Muslims in neighbouring countries, such as the Rohingya of Myanmar, and to launch cross-border terrorist attacks, most likely into India - as they did when Khaleda Zia and the Jamaat-e-Islami were last in power.
As the situation evolves, the government will find that terrorism cannot be fought by a one-party state. It requires a clear, honest narrative and unity among elected political forces. With the opposition absent from parliament and its leaders on trial, however, the signs are ominous.
Tom Hussain is a journalist and Pakistan affairs analyst based in Islamabad.
The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial policy.
Source: Al Jazeera