MOGADISHU, Somalia — Somalia President Sheikh Sharif Sheikh Ahmed planned festive celebrations to mark his first year in office and progress made toward establishing peace and stability in the war-racked country.

But Al Shabaab — the Islamic rebels allied with Al Qaeda — had other ideas.

Mogadishu was hit by the worst fighting in months on Jan. 29 as the insurgents marked the anniversary of the Somali president’s first year in power with a series of violent attacks that elicited an equally deadly response.

Al Shabaab, the Islamic extremists allied with Al Qaeda, attacked government positions protected by African Union peacekeepers (AMISOM) in a concerted salvo against a weak and largely ineffectual administration.

Somalia has been without a functioning government since 1991 when the last one, a military dictatorship, collapsed after a three-year civil war. Since then the country has been without a functioning government. Mogadishu was where the infamous Black Hawk Down incident occurred in 1993, in which 18 U.S. soldiers died. In recent years Somalia's lawless state has allowed piracy to flourish along the Indian Ocean coast. Somali pirates have hijacked scores of ships for millions of dollars in ransom.

Early last year a new United Nations-backed government was sworn in and with it came hopes that Somalia may take a few faltering steps toward peace. Instead a fresh insurgency began in May and the government has been under siege ever since.

From 2 a.m. onward the regular thump of mortars and bursts of machine gun fire shattered the night. Later came the ear-rending bangs of tank fire as African Union peacekeepers pushed back Al Shabaab fighters who were attacking government positions and peacekeeping detachments across the city.

There was a lull in the gunfire and shelling mid-morning when GlobalPost crossed town to watch President Sheikh Sharif Ahmed’s anniversary celebrations at Villa Somalia, his fortified presidential palace on a hilltop overlooking Mogadishu.

The program was to include choirs, poetry, comic theater and speeches. Ahmed, 43, sat in a huge leather and lacquered wood armchair flanked by his prime minister and the speaker of Parliament.

The whitewashed walls of the hall were hung with handmade banners congratulating the president on his first 12 months in office. A crowd of hundreds of dignitaries, government officials and well-wishers were seated on plastic chairs facing the wooden stage.

These sorts of ceremonies are a rarity in Mogadishu, a city that has been destroyed by rounds of civil war that have lasted more than 20 years, so this was supposed to be a moment of celebration and a declaration of the government’s intent to return the city to normality.

But President Ahmed’s enemies had other plans. Shortly before 11 a.m. a mortar exploded at a checkpoint at the entrance to Villa Somalia, the sprawling presidential compound.

Sitting waxwork still as he watched a wobbly homemade documentary celebrating the achievements of his first year Ahmed blinked, but otherwise didn’t acknowledge the blast. The besieged president is used to gunfire.

Minutes later a second mortar crashed into a patch of open concrete, just yards from the hall. Dust, smoke and the smell of cordite billowed through the latticework breeze-block walls.

A series of ear-shattering bangs followed and a gathering panic quickly spread through the hall, people looking around nervously. What was going on? What they should do?

Presidential aides rushed in waving their arms in a “go away” motion: The fire was outgoing, not incoming. AMISOM is tasked with defending the president and Villa Somalia from attack so they were firing back from tank positions at either side of the hall. There were nervous smilesand laughs. The ceremony continued.

A mixed male and female choir took to the stage singing in the different dialects of Somalia’s main clans, a symbolic display of unity in a country so often torn apart by inter-clan battles. They struggled to be heard over the volleys of rockets firing outside.

Soldiers said the rockets were ‘katyushas’ targeting insurgent positions in Bakara Market a couple of miles away. “They have hit us so we are hitting them back,” said one.

A Ugandan peacekeeper killed in the first mortar attack, and others with injuries, were rushed across town in an armored convoy to the AMISOM base for treatment. Wounded civilians were dealt with on the spot.

A poet took to the stage as outside the hall casualties were ferried to a makeshift trauma room in the nextdoor building. One man was helped as he walked by, his arm bleeding; another was carried in a tarpaulin litter. Heavy machine gun fire thudded away in the background.

Then as the performances came to an end and the people gathered inside stood for Somalia’s national anthem a battered pickup truck arrived to collect the injured men.

One was carried out attached to a saline drip grimacing with pain, another walked holding a bloody bandaged hand aloft, a third clutched a dressing to his abdomen.

GlobalPost caught up with the president of Somalia, Sheikh Sharif Ahmed, late last year in Chicago:

The anthem wound up and the crowd in the hall applauded as Ahmed took to the stage to deliver a speech. Outside, the pickup with its damaged human freight sped away.

Afterward a senior Ugandan officer said that two alleged collaborators had been arrested, accused of coordinating the shelling via mobile phone from within the presidential palace itself.

Later in the day reports came in that 19 people were killed and more than 30 people injured in the combat.

The deadly attacks targeting one of the handful of supposedly secure places in Mogadishu underlined again the vulnerability of the government and the fragility of life in a city that daily reasserts its reputation as one of the most dangerous places on earth.