Every morning, emaciated parents with emaciated children stagger into Banadir Hospital, a shell of a building with floors that stink of diesel fuel because that is all the nurses have to fight off the flies. Babies are dying because of the lack of equipment and medicine. Some get hooked up to adult-size intravenous drips — pediatric versions are hard to find — and their compromised bodies cannot handle the volume of fluid.

Most parents do not have money for medicine, so entire families sit on old-fashioned cholera beds, with basketball-size holes cut out of the middle, taking turns going to the bathroom as diarrhea streams out of them.

"This is worse than 1992," said Dr. Lul Mohamed, Banadir's head of pediatrics, referring to Somalia's last famine. "Back then, at least we had some help."

Aid groups are trying to scale up their operations, and the United Nations has begun airlifting emergency food. But many seasoned aid officials are speaking in grim tones because one of Africa's worst humanitarian disasters in decades has struck one of the most inaccessible countries on earth. Somalia, especially the southern third where the famine is, has been considered a no-go zone for years, a lawless caldron that has claimed the lives of dozens of aid workers, peacekeepers and American soldiers, going back to the "Black Hawk Down" battle in 1993, spelling a legacy that has scared off many international organizations.

"If this were Haiti, we would have dozens of people on the ground by now," said Eric James, an official with the American Refugee Committee, a private aid organization.

But Somalia is considered more dangerous and anarchic than Haiti, Iraq or even Afghanistan, and the American Refugee Committee, like other aid groups, is struggling to get trained personnel here.

"It is safe to say that many people are going to die as a result of little or no access," Mr. James said.

This leaves millions of famished Somalis with two choices, aside from fleeing the country to neighboring Kenya or Ethiopia, where there is more assistance. They can beg for help from a weak and divided transitional government in Mogadishu, the capital. Just the other day there was a shootout between government forces at the gates of the presidential palace. "Things happen," was the response of Abdiweli Mohamed Ali, Somalia's new prime minister.

Or they can remain in territory controlled by the Shabab, who have pledged allegiance to Al Qaeda and have tried to rid their areas of anything Western — Western music, Western dress, even Western aid groups during a time of famine.

Much of the Horn of Africa, which includes Kenya, Somalia, Ethiopia, Eritrea and Djibouti, has been struck this summer by one of the worst droughts in 60 years. But two Shabab-controlled parts of southern Somalia are the only areas where the United Nations has declared a famine, using scientific criteria of death and malnutrition rates.

People from those areas who were interviewed in Mogadishu say Shabab fighters are blocking rivers to steal water from impoverished villagers and divert it to commercial farmers who pay them taxes. The Shabab are intercepting displaced people who are trying to reach Mogadishu and forcing them to stay in a Shabab-run camp about 25 miles outside the city. The camp now holds several thousand people and receives only a trickle of food.

"I was taken off a bus and put here," said a woman at the camp who asked not to be identified.

Several drought victims who have succeeded in making it to Mogadishu said that the Shabab were threatening to kill anyone who left their areas, either for refugee camps in Kenya and Ethiopia, or for government zones in Somalia, and that the only way out was to sneak away at night and avoid the main roads.

A few years ago, the Shabab began banning immunizations, deeming them a Western plot to kill Somali children. Now countless unvaccinated children are dying from measles and cholera as tens of thousands of malnourished, immunity-suppressed people flee the drought areas and pack into filthy, crowded camps.

The other day, Kufow Ali Abdi, a destitute herder who lost all his cattle, trudged out of Banadir Hospital, gently carrying a small package in his arms wrapped in blue cloth. It looked almost like a swaddled newborn but it was the opposite. It was the body of his 3-year-old daughter, Kadija, who had just succumbed to measles.

"I just hope they can save the others," he said, referring to his two remaining children, down to skin and bone.

The magnitude of suffering could shift the political landscape, which has been dominated by chaos since 1991, when clan warlords overthrew the central government and then tore apart the country. The Transitional Federal Government — the 15th attempt at a government — is trying to assert itself and beat back the Shabab, and the famine and attendant relief effort could mean an enormous opportunity.

"It could be a face-lift for them, an opportunity to deliver services and show they are committed," said Sheik Abdulkadir, a militia leader. "But if a lot of people die here, people will say it's the government's fault."

The famine could affect the Shabab as well, deepening the fissures in their organization. Shabab leaders are now beginning to cut their own deals in the face of mass starvation. Unicef recently delivered a planeload of food and medicine to Baidoa, a Shabab stronghold. In Xarardheere, another Shabab-controlled town and a notorious pirate den, a Shabab commander said in an interview on Saturday that he would welcome Western aid organizations despite the anti-Western policies imposed by his leadership, which has been hit by the deaths of several prominent figures recently.

Sheik Yoonis, a Shabab spokesman, said in an e-mail that the declaration of a famine was "an exaggeration." He said that Shabab fighters were not imprisoning people in the camp, but that the people were attracted to it by "this sense of serenity and security." He also denied that the Shabab were diverting river water or scaring away aid agencies.

Still, many aid organizations are reluctant to venture into Shabab areas because of the obvious dangers — the Shabab have killed dozens of aid workers — and because of American government restrictions. In 2008, the State Department declared the Shabab a terrorist group, making it a crime to provide material assistance to them. Aid officials say the restrictions have had a chilling effect because it is nearly impossible to guarantee that the Shabab will not skim off some of the aid delivered in their areas.

Even United Nations contractors have been accused of siphoning food aid, resulting in extensive investigations and cuts in life-saving assistance.

Western aid agencies are now trying to work through Islamic and local organizations as much as possible, but the Somali partners do not usually have as much technical expertise. And heavy fighting has erupted in Mogadishu again, making it dangerous even for Somali aid workers.

"Somalia is one of the most complicated places in the world to deliver aid, more complicated than Afghanistan," said Stefano Porretti, who heads the World Food Progam's efforts in Somalia and recently worked in Afghanistan.

Mohammed Ibrahim contributed reporting.