Thousands of sacks of food aid meant for Somalia's famine victims have been stolen and are being sold at markets in the same neighbourhoods where skeletal children in filthy refugee camps can't find enough to eat, an Associated Press investigation has found.

The UN's World Food Program for the first time acknowledged it has been investigating food theft in Somalia for two months. The WFP said that the "scale and intensity" of the famine crisis does not allow for a suspension of assistance, saying that doing so would lead to "many unnecessary deaths."

Children from southern Somalia lineup to receive cooked food in Mogadishu on Monday. (Farah Abdi Warsameh/Associated Press)

And the aid is not even safe once it has been distributed to families huddled in the makeshift camps popping up around the capital. Families at the large, government-run Badbado camp said they were often forced to hand back aid after journalists had taken photos of them with it.

Ali Said Nur said he received two sacks of maize twice, but each time was forced to give one to the camp leader.

"You don't have a choice. You have to simply give without an argument to be able to stay here," he said.

The UN says more than 3.2 million Somalis — nearly half the population — need food aid after a severe drought that has been complicated by Somalia's long-running war. More than 450,000 Somalis live in famine zones controlled by al-Qaeda-linked militants, where aid is difficult to deliver. The U.S. says 29,000 Somali children under the age of 5 already have died.

International officials have long expected some of the food aid pouring into Somalia to go missing. But the sheer scale of the theft taking place calls into question aid groups' ability to reach the starving. It also raises concerns about the willingness of aid agencies and the Somali government to fight corruption, and whether diverted aid is fuelling Somalia's 20-year-civil war.

"While helping starving people, you are also feeding the power groups that make a business out of the disaster," said Joakim Gundel, who heads Katuni Consult, a Nairobi-based company often asked to evaluate international aid efforts in Somalia. "You're saving people's lives today so they can die tomorrow."

WFP Somalia country director Stefano Porretti said the agency's system of independent, third-party monitors uncovered allegations of possible food diversion. But he underscored how dangerous the work is: WFP has had 14 employees killed in Somalia since 2008.

"Monitoring food assistance in Somalia is a particularly dangerous process," Porretti said.

In Mogadishu markets, vast piles of food sacks are for sale with stamps on them from the World Food Program, the U.S. government aid arm USAID and the Japanese government. The AP found eight sites where aid food was being sold in bulk and numerous smaller stores.

Among the items being sold were corn, grain, and Plumpy'nut — a specially fortified peanut butter designed for starving children.

As much as half the aid being stolen

An official in Mogadishu with extensive knowledge of the food trade said he believes a massive amount of aid is being stolen — perhaps up to half of aid deliveries — by unscrupulous businessmen.

The percentage had been lower, he said, but in recent weeks the flood of aid into the capital with little or no controls has created a bonanza for businessmen.

The official, like the businessmen interviewed for this story, spoke on condition of anonymity to avoid reprisals.

The AP could not verify the official's claims. WFP has not said how much food aid it believes is being diverted.

At one of the sites for stolen food aid, about a dozen corrugated iron sheds are stacked with sacks. Outside, women sell food from open 110-pound sacks, and traders load the food onto carts or vehicles under the indifferent eyes of local officials.

Stolen food aid is not new in Somalia — it's the main reason the U.S. military become involved in Somalia during the country's 1992 famine, an intervention that ended shortly after the military battle known as Black Hawk Down. There are no indications the military plans to get involved in this year's famine relief efforts.

'Supply lines remain highly vulnerable'

WFP said in a statement that it has put into place "strengthened and rigorous" monitoring and control in Somalia.

"However, given the lack of access to much of the territory due to security dangers and restrictions, humanitarian supply lines remain highly vulnerable to looting, attack and diversion by armed groups," WFP told the AP.

Somali government spokesman Abdirahman Omar Osman said the government does not believe food aid is being stolen on a large scale but if such reports come to light, the government "will do everything in our power" to bring judicial action.

The AP investigation also found evidence that WFP is relying on a contractor blamed for diverting large amounts of food aid in a 2010 UN report.

Eight Somali businessmen said they bought food from the contractor, Abdulqadir Mohamed Nur, who is known as Enow. His wife heads Saacid, a powerful Somali aid agency that WFP uses to distribute hot food. The official with extensive knowledge of the food trade said at some Saacid sites it appeared less than half the amount of food supplied was being prepared.

Attempts to reach Enow or his wife for comment were not successful.