MOGADISHU, Somalia — Al Shabaab rebels left Mogadishu two weeks ago but their threat remains as famine refugees flood into this war-torn capital every day in search of food, water and medical care.

The Islamic extremist leaders of Al Shabaab, who are allies with Al Qaeda, have warned of suicide attacks, roadside bombs, sniper fire and hit-and-run ambushes and security officials in the city are on alert for such violence.

The withdrawal of the Islamist insurgents mean the city's frontlines have shifted dramatically so that the 9,000 African Union soldiers (AMISOM) and the government forces that fight alongside them now have almost the whole of this broken seaside city to defend, rather than just a few neighborhoods.

In the recently-vacated parts of the capital, AMISOM and Transitional Federal Government (TFG) troops are warily moving in, occupying parts of the city that have been off-limits for years, trying to get in before the tens of thousands of famine-stricken Somalis, seeking food, shelter and famine relief in the capital, build makeshift camps.

More from GlobalPost in Mogadishu: Famine refugees flee to war-torn city (VIDEO)

More than 100,000 Somalis have flocked to the war-pocked city in the past few weeks and more arrive daily.

Al Shabaab leaders have promised to return with violence. An Al Shabaab spokesman told local radio stations that the withdrawal was merely a change of tactics, not a retreat. "We aren't leaving you, but we have changed our tactics,” said Mohamed Ali Rage.

“Every one of you will feel the change in every corner and every street in Mogadishu. We will defend you and continue the fighting,” he said.

During its four-year rebellion Al Shabaab extremists have increasingly employed the guerrilla methods of Islamic extremists in Afghanistan and Iraq, launching “asymmetric” attacks against a more powerful and better-equipped opponent.

“Even if we occupy all of the city there will still be elements of Al Shabaab inside, there is no [such thing as] total security in Mogadishu,” said Brigadier General Audace Nduwumunsi, deputy commander of AMISOM.

More from GlobalPost: Somalis Flee To Kenyan Refugee Camps (Photo Gallery)

Into this uncertainty international aid agencies are carefully beginning to tread, keen to provide support to the hungry but wary of the threat of violence.

“It’s still a very fluid situation. Security is a very difficult issue. We’re all trying to understand what is going to happen,” said Mark Bowden, the U.N.’s top humanitarian official for Somalia, to GlobalPost during a recent visit to Mogadishu.

AMISOM commanders are particularly concerned that suicide bombers might infiltrate the makeshift camps where people have made their homes after fleeing the famine. Recently two men were found in a camp with suicide vests.

Somalia’s U.N.-backed transitional government greeted the withdrawal of the insurgents as a military victory. Al Shabaab was unable to defeat AMISOM’s armor and then the famine and drought have hit the group’s finances as the rebels were unable to levy taxes on withered crops and decimated herds, according to analysts in Mogadishu.

More from GlobalPost: Tales of horror as refugees arrive from Somalia

This week AMISOM discovered a cache of tons of artillery shells in Bakara market as well as a bomb-making factory with boxes of fuses, wires and ready-to-use homemade explosive devices packed with ball bearings and bolts.

“We are convinced Shabaab has not given up,” said the Burundian commander at a new base called "Exit Control," five miles outside Mogadishu.

Around him, amid the wild growth of thorn bushes and cactus, troops filled sandbags, dug foxholes and fixed missile launchers and heavy caliber machine guns to watchtowers along the fortified walls.

“Al Shabaab have their first checkpoint 300 meters away and a base just a few kilometers further down the road,” the commander explained.

The old ministry of defence headquarters in northern Mogadishu was taken by AMISOM six months ago in fighting that killed dozens of its soldiers. Dislodged from their base, Al Shabaab fighters moved down the road to the crumbling shell of an abandoned cigarette factory.

Two weeks ago as Al Shabaab pulled out of Mogadishu, its fighters abandoned the factory which AMISOM is now turning into a support base for its troops manning the new frontline. Soldiers sit behind a wall of sandbags and gun placements waiting for the sniper fire that comes every evening.

Nevertheless, Mogadishu is busier — and more peaceful — than in years. The streets of the Medina district are crowded with minibus taxis, stalls selling fruit and meat, donkey carts, hardware stalls and pharmacies. Many of the traders moved here from Bakara Market, a former Al Shabaab stronghold that businesses are wary of returning to.

“People want to go back to their homes,” deputy mayor Iman Icar told GlobalPost. “People are tired and fed up of the war.”

Icar said the current lull in fighting “doesn’t compare” to the peace under the six-month long rule in 2006 of the Islamic Courts Union but it is a huge improvement from the recent fighting.

Mustafa Ahmed, a teacher living in Mogadishu's Wardhigley district in a house with wild sprays of overgrown bougainvillea cascading over the bullet-pocked garden wall, agreed that the city is more peaceful than it has been for years.

“Now Shabaab is gone we have to learn to live together," he said. "All of us must accept each other as Somalis.”