analysisBy Abdullahi Boru Hallakhe and Abdihakim Ainte
Last week's attack on a Likoni church in the coastal city of Mombasa, and the subsequent Eastleigh blast in Nairobi, are grim reminders of the precarious state of Kenya's security. If the current situation is not judiciously handled, it could easily be exploited and then morph into a sectarian conflict.
Kenya's handling of the war on terror and, broadly, its fight against al-Shabaab provide clues for a better understanding of the Likoni church attack and the recent escalation of violence in Kenya.
For al-Shabaab - the alleged perpetrator of the Likoni attack - just like al-Qaeda, there is a logic to targeting places of worship. They intend to drive a wage between faiths and ignite a conflict between Muslims and non-Muslims. Al Qaeda did it in Iraq, Syria, Afghanistan, Egypt and Mali.
At the national level, however, Kenya is playing into al-Shabaab's hands. In 2012, a year after the intervention in Somalia, a draconian anti-terrorism bill was passed.
Kenyan law enforcement has used the bill as a blank check against any communities that it does not entirely trust - especially Kenyan Somalis. While marginalization of Somalis is nothing new, the new law provides a degree of legitimacy for it.
Kenya has also demonstrated an instinct for sweeping knee jerk reaction. For instance, the Cabinet Secretary in charge of internal Security, Joseph Ole Lenko, issued a directive that all Somali refugees outside the camps in the north east of the country should go back there.
This directive implicitly labels all Somali refuges as potential terrorists. But this demonstrates a gross misreading of al-Shabaab's transitional nature - the group's membership is no longer exclusively Somali and includes many Kenyans. The directive is also in contradiction of Kenya's international obligations towards refugees.
Furthermore, the Kenyan security services' recent sweep and mass arrest on Somali refugees in Eastleigh will further radicalize and discourage refugees from collaborating with police and security intelligence.
The foundation of these developments is a function of the decades-long demonization of Kenya's Somali population and the subsequent securitization of Kenya's overall approach to Somalia.
This approach has, however, thus far proved counterproductive - it hasn't kept Kenyans safe, as evidenced by last year's attack on the upscale Westgate Centre and the continuing deterioration of the country's security.
In the past few months, a leading Kenyan columnist made the case that the country should annex Somalia, whilst the editor of a leading national publication called all Somalis 'terrorists'. Such demonization of Somalis at the state level as well as in the media is unhelpful. A new discourse and a genuine debate on Kenya and Somalia's relationship seems distant.
In al-Shabaab's propaganda war, such vilification will only serve in their favor and will play into their hands to further justify anti-Kenyan propaganda.
Kenya and Somalia share a common security problem but currently the 2 countries are working at cross-purposes. But they have mutual economic and security interests which should be mutually reinforcing to the benefit of each.
Kenyan Somalis have also demonstrated their enormous entrepreneurial spirit despite ongoing demonization. Kenya can leverage this spirit by lending institutional support to the nascent Somali government's institutions. Additionally, Kenya's boundary-less market needs a stable environment to grow, which demands security and safety. Somalia's stability is in Kenya's interest.
Post al-Shabaab Security Kenya-Somalia cooperation should be guided by a common post-al-Shabaab vision. The group's capacity has been significantly degraded, but they are not yet done.
A combination of African troops under AMISOM and the Somali National Army has pushed the group from most of their territories. This combined momentum against the group could potentially turn the tide and presents an opportunity for peace and stability in Somalia.
But al-Shabaab remains very diffuse and it has cells and sympathizers in both Kenya and Somalia. As a franchise organization, their core strategy revolves around hit-and-run tactics - a modern guerilla form of war. In this way, they are now far more lethal and still capable of launching sophisticated attacks within the region.
Facing a domestic backlash, al-Shabaab has retreated into the people and has attempted to infiltrate the porous border between Kenya and Somalia. As result, al-Shabaab is now focused on the near-enemy - evidenced by the worsening security situation in Nairobi.
While al-Shabaab is degrading militarily, Somali's future is thankfully more promising. And this is where hope lies. For first time in nearly two decade, the international community has shown a considerable interest in Somalia's future. Plenty of countries have reopened their embassies in Somalia, including Kenya.
With Turkey, the UK and Norway rebuilding the much-needed social infrastructure, business and reconstruction are thriving. Countless Kenyan construction companies are also jumping on the bandwagon, providing employment opportunities for both Kenyans and Somalis. Eventually, al-Shabaab will be neutralized through its most challenging opponent - development and employment.
To avoid an al-Shabaab resurgence, Kenya and Somalia need to understand that there is currently a brief opportunity to heighten security cooperation and build a new integrated and interagency partnership to strengthen the nascent security apparatus, thereby consolidating fragile gains.
Therefore, Kenya, as one of the troop contributing countries in AMISOM, needs to take a more constructive role to ensure stable post-al-Shabaab governance in Somalia.
Failure in Kenya-Somalia cooperation on security, diplomacy and intelligence will allow al-Shabaab and its sympathizers a chance to reorganize, regroup and bounce back.
Deepening security cooperation in eliminating al-Shabaab will deliver an enormous peace dividend that benefits not only Kenya and Somalia, but also the entire region.
Abdihakim Ainte is Somali political commentator and consultant. He tweets @Abdikhakim
Abdullahi Boru is Horn of Africa Analyst. He tweets @QulshTM