People trapped at home for weeks emerged in search of food at barren shops while corpses lay exposed in the Swat Valley's main city Sunday, as a Pakistani official suggested the army offensive against the Taliban in the region could end in days.

Elsewhere along the Afghan border area, dozens of militants died in clashes with soldiers in a tribal region, fighting that could nudge the military to expand its offensive beyond Swat.

An Associated Press reporter who visited Mingora a day after the army declared it was secured saw many damaged buildings. Two decomposing bodies, apparently those of insurgents, lay unburied in a cemetery; a third, charred corpse lay near a shopping mall.

The smell of explosives hung in the air.

"We have been starving for many days. We have been cooking tree leaves to keep ourselves alive. Thank God it is over," said Afzal Khan. "We need food. We need help. We want peace."

Pakistan launched an offensive against militants in Swat and surrounding districts last month after they violated the terms of a cease-fire and advanced into a region close to the capital, Islamabad.

Speaking in Singapore, Pakistan's defense secretary predicted the army would clear remaining militant strongholds in the valley in "two to three days." Pakistan's military spokesman said that assessment was overly optimistic.

The Swat offensive has earned U.S. praise as troops have regained large swaths of the region from an estimated 4,000 militants. The fighting has forced up to 3 million people to evacuate.

In South Waziristan tribal region, meanwhile, insurgent attacks on an army convoy and checkpoint Saturday night sparked clashes that left scores scores dead. About 50 militants and two soldiers were killed, according to two intelligence officials who spoke on condition of anonymity because they were not authorized to talk to media.

A military statement Sunday said at least 25 militants and seven soldiers died in South Waziristan, the main stronghold of Pakistani Taliban chief Baitullah Mehsud. Qari Husain Ahmed, a Taliban commander in South Waziristan, disputed both accounts, telling AP via phone that only two militants died.

The differences could not immediately be reconciled.

Most of Mingora's at least 375,000 residents fled before or during the offensive. The military briefly lifted a curfew Sunday, allowing some of the 20,000 or so who remained to buy provisions in the few shops that were open.

Ali Rehman said he had not left his house for 25 days.

"I never knew who was fighting and who was being killed," he said, clutching two bags of flour. "I need help to keep my family alive because I do not have any source of income anymore."

Officials from the International Committee of the Red Cross visiting other parts of the valley Saturday were "alarmed."

"People have been blocked for weeks," team leader Daniel O'Malley said in a statement released Sunday.

"There is no running water, no electricity, and food is scarce. There is no fuel left for generators and most medical facilities in the district are no longer functioning. Phone lines are down, so people have been cut off from the outside world and are anxious for contact with relatives who fled the area."

The military said relief work was proceeding in Mingora but it will be at least two weeks before power is restored there, so refugees are not being encouraged to return home yet.

More than 1,200 militants have been killed in the Swat offensive, according to the military — a figure that cannot be independently verified. The military has not released civilian casualty numbers and it is unclear how it distinguishes militants from noncombatants.