(CNN) -- More than 40,000 Somalis have returned to the abandoned neighborhoods of Mogadishu in the past six weeks, despite some of the heaviest fighting in months, the U.N. High Commissioner for Refugees said Friday.
Violence continued this week in Mogadishu between Somali Islamist fighters and African Union soldiers.
They are part of more than a million residents who have been displaced by fighting, including 100,000 who fled to neighboring countries last year, according to the United Nations.
Most of those returning are families from Somalia's southern and central regions, areas that are suffering from drought and renewed fighting, according to UNHCR. They are now living in neighborhoods in northern Mogadishu that had been abandoned over the past two years of conflict, the U.N. agency said.
Part of the reason displaced Somalis may be braving the violence and returning to the war-torn capital city is because of the recent pullout of Ethiopian troops, who were blamed for indiscriminately killing civilians in Mogadishu, a Somali journalist said.
"The AU [African Union] and [Somali] government forces only defend in their positions, they don't move around," according to Mohammed Amiin Adow. "This may reduce the fear of the civilians that their homes may be raided.
"During the Ethiopian presence, it was different: When their bases were attacked, they used to come and carry out search operations in which civilians may be detained, killed or wounded."
Adow also said another reason refugees may be returning is the bad conditions at the camps for internally displaced Somalis.
"People had been living in very poor conditions in the makeshift camps on the road between Mogadishu and Afgooye for the last two years," Adow said. "So that is I think why people are returning."
Those returning to Mogadishu will have limited access to basic necessities, a problem that is compounded by the scarcity of international aid agencies, who have fled Somalia because of the violence, UNHCR spokesman William Spindler said Friday.
"UNHCR is not encouraging returns to Mogadishu at this juncture, as the security situation is volatile and the conditions are certainly not conducive," he said. "Nevertheless, we are preparing to help returnees or those who wish to return in the near future, in the hope that the security situation will improve."