As the New Year’s countdown concluded in Kampala, fireworks exploded and the power promptly failed. Electricity outages are not uncommon in Uganda’s capital, but the timing on this occasion was ominous.

A specific terrorist threat had been made against Kampala for New Year’s Eve and there was an element of tension in the air that went beyond anything generated by the prospect of a sneaky midnight pash. As we waited for the emergency generators to kick in and the music to resume we couldn’t help but wonder, had Al-Shabaab finally blown up Uganda’s hydroelectric dam?

Of course, 10 minutes into 2011 it was obvious that nothing major had gone wrong. People got back to partying — which is an activity taken very seriously in Uganda. But you couldn’t blame us for being nervous. Six months ago Kampala was the target of an Al-Shabaab suicide bombing during the World Cup final, which left 74 dead.

So why is a militant Islamic group, which controls much of Somalia, making terrorist attacks in Uganda? The answer is simple. Ugandan troops make up the major component of the African Union peacekeeping mission currently in Somalia. The international community has recognised Al-Shabaab as a major threat to global security — but in a world with too many international interventions in progress already, Uganda has been left with most of the grunt work. Al-Shabaab and Uganda are effectively at war.

Just 10 days earlier, while on my way to Uganda, I almost had my own run in with Al-Shabaab. I was on my way from Nairobi to Kampala when a Kampala-bound bus was blown up at the Nairobi terminal. Luckily I had changed my plans and travelled a day earlier to visit a friend along the way.

When we first heard the news we were just sitting down to dinner. Someone called to check we were still alive. Frantically we turned on the TV and started making calls ourselves. My housemate was making the trip that night. When she answered the phone and told me she was travelling with another coach company I almost collapsed with relief.

The fact that the Kampala coach attack occurred on Kenyan soil is significant. Uganda remains committed to fighting Al-Shabaab but is also very serious about the security measures needed to protect itself from such an enigmatic enemy. Practically speaking, Kenya, which shares a border with Somalia and is home to many Somali refugees, is a much easier target.

So all of this talk of terrorists may be painting a pretty grim picture of Uganda — and it is a shame because that really isn’t the case. At the risk of gushing, my experience here has been unwaveringly positive — a beautiful and generous country that has shown remarkable resistance to the troubles it has faced. And of course for all the nervousness on NYE there was no violence. Security was tight and efficient. When midnight came and went without incident, Kampala simply let out a breath and kept dancing till morning.