After six months working with the United Nations in Sana’a, Yemen, I was rather looking forward to my return home next week to Nairobi. That was put into a new context when my wife called me Saturday within an hour of the al-Qaeda-linked Al-Shabaab attack on Westgate shopping mall.

Her first information was from two UN friends/colleagues calling to let her know that they were safe. However, a recently retired colleague was dead; my wife had talked with him barely a week earlier about his excitement at taking up an academic posting in England within the next fortnight. On Sunday morning she visited another UNICEF colleague and the murdered colleague’s teenage daughter in the Aga Khan Hospital, where both had undergone treatment for gunshot wounds.

The Westgate Mall is well known to both the international community and to the Nairobi middle class, making it an ideal Al-Shabaab target (although hindsight is, naturally, a wonderful thing). The timing of the attack ensured the mall was full of families and young children, given its blend of shops, cinemas, children’s play areas, cafes and restaurants. The attackers are understood to have invited all Muslims to stand up and safely vacate the mall, claiming that they were showing (non-Muslim) Kenyans what Kenyan forces were inflicting upon Muslim Somalis over the border. By Sunday afternoon, there were reports that Israeli forces were assisting the Kenyan authorities (neither confirmed nor denied by the Israeli foreign ministry), as the Westgate Mall is partly Israeli-owned. That short-term gain could yield long-term pain for Kenya.

There had, of course, been an expectation of some Al-Shabaab payback to Kenya for finally entering into the regional conflict in Somalia in late 2011. This was Kenya’s first declaration of war. It acted separately from the African Union’s own UN-mandated AMISOM intervention in Somalia but merged its foray with the AMISOM intervention some weeks later. Kenya’s decision up until then of staying out of direct involvement had equipped it well to play mediation roles that had, obviously, been more successful at quarantining it from spill-over conflicts than in bringing such conflicts to an end.

Kenya’s non-intervention policy had certainly been important for domestic security, given the large numbers of Somalis crossing into northern Kenya (around 500,000 displaced Somalis are temporarily settled in the Dadaab area of Kenya alone) as well as in parts of Nairobi. Elements of Al-Shabaab were known to be active within those Somali populations inside Kenya, but apart from some unattributed (mainly grenade) attacks in late 2011 in Nairobi, the capital was spared any of the anticipated violence for almost two years.

On Saturday, that all changed, although it remains unclear what the attack will mean for local security procedures and the political response. This is mainly a consequence of the AMISOM and Kenya Defence Forces occupation of the southern Somali port city of Kismayo in early 2012, which had been Al-Shabaab’s main base and source of revenue. This dispersed many Al-Shabaab militants, mainly to northern parts of Somalia but also into Kenya and elsewhere.

As a footnote, I commented in Crikey just over 18 months ago that oil is, as usual, a key factor. Kenya discovered large oil reserves in its north-western county of Turkana in early 2012 and needed a more stable border with Somalia in order to construct a major oil pipeline to the Indian Ocean. This is additionally important as Kenya’s main port of Mombasa is already overloaded and subject to destabilisation from local Islamic separatist agitation.

Turkana borders both Uganda and South Sudan, as well as Ethiopia. It is a desolate and underdeveloped area of Kenya that has been traditionally disregarded by the central government in Nairobi, and otherwise largely only known for its archaeological significance (the Leakeys and Turkana Boy). The proposed pipeline will reach the Indian Ocean coast of Kenya at Lamu — a UNESCO heritage site and pristine coast of mangroves set to undergo “transformation” — which is less than 100 kilometres south of the Somali border.

Al-Shabaab attacked far more than a Nairobi shopping mall. Nairobi is host to (as I understand it) the largest UN community outside of New York and a huge international diplomatic community often serving the wider east African region. The Kenyan political leadership will be keen to demonstrate its credentials to the international (read: in this case, Western) community, which has spent much of the past week grappling with how to respond to Kenya’s snubbing of the International Criminal Court, where Deputy President William Ruto currently sits and President Uhuru Kenyatta is due to appear in November. Kenya’s stance has struck a chord with many African states and has become an inspiration for China as well, to the double-edged alarm of the European Union.

The past few days have opened a critical new stage in Kenya’s geopolitical manoeuvrings and presented Kenyatta with his biggest challenge merely six months after assuming the presidency.