DADAAB, Kenya – The people mass outside the gates hundreds deep and eerily still, many squatting in the red dirt holding emaciated children. They wait for water and medicine. But most of all, they wait for an open spot at the world’s largest refugee complex.

The worst drought in decades has blistered large parts of the Horn of Africa, turning it into a hellscape of deserted villages and dead rivers. The United Nations says 12 million people need emergency aid.

Those hardest to reach are in Somalia, where a quarter of the country’s 7.5 million people are on the move. Help has been blocked by al-Shabab, a militant group linked to al-Qaida, which controls some famine-stricken areas and is suspicious of foreign aid agencies.

The result is streams of refugees, struggling miles through dry desert wind and fine, sleeting sand in search of sanctuary.

Every day, more than 1,000 of them arrive at the gates of the Dadaab refugee complex in northeastern Kenya. The 19-square-mile sprawl, created in the early 1990s to accommodate refugees fleeing political chaos in Somalia, now holds 372,000 people, more than four times its original capacity.

Waiting outside the camp gates one recent morning, Ali Hulbale, 30, said he arrived with his wife and children two months ago but had yet to be registered for camp services. So he lives on the outskirts, amid countless squatter huts built of sticks and ragged cloth.

Hulbale had been an important man in his village in southern Somalia, with 60 goats and 50 cows. Then the river shrank to a trickle and his livestock began to sit. That meant they had days to live.

He waited until the last was dead, three months ago, before making a desperate 25-day pilgrimage across the bandit-plagued Somali desert to the border, then struggled 50 more miles to Dadaab.

The onrush of refugees has created a backlog of 17,000 people who can languish for months before they are registered, said Alexandra Lopoukhine, a spokeswoman for the aid agency CARE International.

Lopoukhine said the vast majority of new arrivals are women and children. Some refugees are sent to a tented camp extension, but the aid group Doctors Without Borders has complained that it lacks a hospital and does not meet “minimum humanitarian standards.”

Another more permanent extension has been built to accommodate 40,000 to 60,000 refugees, with neat rows of brick buildings and a secondary school.

The U.N. said the first group of refugees recently moved into the new facility, despite the reluctance of the Kenyan government to see another camp take permanent root. Kenyan officials have described the presence of so many refugees as a security threat.

Security is also a constant worry for those living at Dadaab. Bandits lurk in the surrounding desert, and some aid workers suggest that al-Shabab has been recruiting fighters in the camps for the militia’s battle against Somalia’s wobbly transitional government.

Women venture to the camp outskirts to forage for firewood, and return bowed under the big bundles lashed to their backs. They run at the sight of official-looking vehicles. Stripping the trees has angered local Kenyans.

The U.N. has been able to deliver food to Mogadishu, Somalia’s war-battered capital. But “we’re not able to get much farther than that,” said Matthew Conway, a spokesman for OCHA, the U.N. body that coordinates humanitarian response. Conway said the U.N. was considering airdrops of food, and was appealing to Persian Gulf states and Islamic agencies in the hope they would find success where Western groups have not.

Hulbale said that as drought destroyed his village, the community prepared to go to the countryside and perform a ritual asking God for rain. He said the al-Shabab forbade it. “They wanted us to pray in a mosque,” he said.

He said he served as an intermediary between his village and Western aid agencies, but that al-Shabab insisted that the Western agencies had a secret agenda and forced them out. “We tried to talk to them but they never listened,” Hulbale said. If you tried defending the Westerners, he said, “they treat you as an unbeliever. They say you are one of them.”

On his journey to the camp, he said, three children of other families died of hunger and were buried in the desert. Bandits stole his cellphone and, when they could find no money, set fire to the donkey cart bearing the family’s clothes and blankets. Other families spoke of having to fend off hyenas and lions with sticks and machetes.

“It is peaceful here,” Hulbale said, waiting outside the camp gates. “There is no gunfire.

“But we are starving.”