Cradled in his father's arms, 8-month-old Maaz Ayaz appeared listless and underweight.
A smudge of dirt marked the boy's face. His father, Mohammed Ayaz, anxiously talked of how he and his wife could feed Maaz only tea and biscuits -- the only food they could get their hands on at the refugee camp.
"We've asked for milk, but there's none available," Ayaz said. "We're worried about our boy."
Such moments of anguish abound at the Sheikh Yaseen camp in this chaotic, sun-baked city that has become the hub for Pakistanis fleeing the fighting in the Swat Valley, about 30 miles to the north.
Support for the military offensive against the Pakistani Taliban in the northwest has been widespread, cutting across economic and ethnic lines. But that support hinges precariously on how Pakistan manages the massive humanitarian crisis created by the war's displacement of an estimated 3 million Pakistanis.
About 200,000 of the displaced people, nearly all ethnic Pashtuns, are crammed into sprawling tent camps in Mardan and elsewhere in the country. The rest have sought refuge with relatives or friends. At Sheikh Yaseen, more than 7,600 people live in 1,485 tents.
The Pakistani military launched the offensive in April after Taliban militants based in Swat began to assert control over adjoining districts, one of them just 60 miles from the capital, Islamabad.
The broad support for the military campaign could be undermined if the flow of displaced Pashtuns to other regions and cities triggers ethnic tensions. Thousands of Pashtuns have sought shelter in camps and homes in the southern port city of Karachi, where political leaders of the majority ethnic Sindhi population have vehemently opposed their influx.
More than half of Karachi's shops and markets closed May 25 after Sindhi nationalists called for a citywide strike to protest the arrival of Pashtuns from Swat. In the past, many Sindhis have opposed the settlement of Pashtuns in Karachi, saying their presence marginalizes locals and takes away jobs.
Pakistanis have been encouraged by reports of the gains being made by the troops against militants, and, experts say, they are realizing how severe of a threat the Taliban poses if allowed to spread unchecked.
That threat was underscored late last month by a suicide bombing outside security buildings in Lahore that killed 27 people and injured more than 250. Pakistani Taliban leaders have claimed responsibility for the attack.
With no end to the conflict in sight, many of the displaced say they're running out of patience. After trekking for days from the Swat Valley with little more than the clothes they were wearing, they have endured weeks of sweltering heat in cramped tent cities with little sanitation and bare-bones health care. Those lucky enough to get their hands on a donated fan are still waiting for the electricity to power it.
Experts say conditions for displaced residents must be improved soon and the pace of the offensive has to quicken, or the government risks losing the public support needed to sustain momentum against the Taliban. Aftab Sherpao, a former Pakistani interior minister, says the displaced Pashtuns could begin rioting in weeks if the crisis isn't dealt with soon.
"These people have left everything they have," Sherpao said. "If this gets prolonged, there could be a volatile response from refugees, and then support will drop. And if the support isn't there anymore, then we're in trouble."
The Pakistani government and military have been emboldened by a level of public backing not seen before. The difference, experts say, is that people believe the government's resolve to root out Taliban militants is stronger than ever before.
In addition, the military has been able to maintain control of territory after driving out Taliban fighters. Mingora, Swat's largest city, had been seen by many as a crucial test because Taliban militants were braced for combat in an urban environment. Pakistani troops, however, methodically drove militants out of every section of the city, including the infamous town plaza where mutilated corpses were hanged from tree limbs.
Public confidence in the offensive is also bolstered by the fact that, unlike in the past, the country's fractious array of political parties and movements appear to agree on the need for military action against the Taliban. Support from one of Pakistan's most popular politicians, Nawaz Sharif, for the military operation has also helped galvanize public support, said Rasul Baksh Rais, a political analyst in Lahore.
Even among Pashtuns, the main ethnic group in northwest Pakistan, support has grown for the military even as it fights militants who are also Pashtuns. This is largely because of the harshness Taliban rule in areas they controlled. Militants burned down or bombed scores of girls' schools in Swat and carried out public floggings for acts they deemed un-Islamic.
In February, Taliban fighters in Swat agreed to put down their arms if local leaders imposed Sharia, or Islamic law. The Pakistani government acquiesced, hoping the move would bring peace to the region. But soon Taliban militants reneged on the deal, extending their reach into the neighboring district of Buner, upon which Pakistani leaders decided to mount the offensive.
"The Taliban entered into the peace agreement, and then they picked up arms," says Umar Zada, a real estate agent in Mardan. "So it became imperative that this operation be done. We have to do this, or our people will never have peace."
Every day, Umar Zada deals with the fallout of the offensive on his brethren Pashtun; he leads a neighborhood effort to provide food, drinking water and clothing to 175 Pashtun who fled Mingora and now live in a five-room grade school.
The next pivotal step for Pakistani leaders, Umar Zada said, will be reconstruction, to ensure refugees have homes, schools and hospitals to return to once the fighting ends.
"Many innocent people have had their homes destroyed," he said. "Rebuilding has to happen."
At Sheikh Yaseen camp, rebuilding isn't the priority. Getting through the day is.
For a huddle of hungry men suffering through 105-degree heat, temporary relief meant tussling over pieces of ice. They barked at each other and flayed elbows, pouncing on the glistening shards and shoving chips into their mouths while using their dust-covered smocks to haul away larger chunks. By the time they got back to their tents and their families, much of the ice had melted away.
Living at the camp has been particularly agonizing for farmer Lalbat Shah and his family. Fatima, his 5-year-old daughter, was scalded by water from a tea kettle as the family fled their home in Saidu Sharif, the administrative capital of Swat district. The girl has not received any medical attention.
"We've been here 15 days and no healthcare," said Shah, 30, as Fatima, shirtless, stared out from a tent with straw mats as bedding and several hand fans strewn on the ground.
On one recent searing afternoon, the people at the camp mostly huddled inside their canvas tents. A blur of activity came when a supply truck pulled up, triggering an angry scramble that was quelled when security guards with long, thick sticks beat the crowd.
"All we want is peace to return so that we can go back to our homes as soon as possible," said Johar Alishah, 27, a driver from Mingora at the camp with his pregnant wife and 6-year-old son. "These conditions here, we can't bear them anymore."