By Barbara Plett
BBC News, Katcha Ghari camp near Peshawar
Children do not have many facilities at Katcha Ghari camp but they do at least receive an education
Last year Pakistan finally closed camps that had housed Afghan refugees for three decades. During the past six months it's been forced to reopen them, this time for its own people.
In the Katcha Ghari camp near Peshawar, at the edge of abandoned and crumbling Afghan homes, row after row of tents stretch into the distance.
They are divided into clan and family groupings and separated by neatly packed dirt roads, lending an air of permanence to a temporary village.
This is the other side of Pakistan's battle against the Taleban and al-Qaeda.
More than half a million people have been displaced by the fighting in the tribal belt near the Afghan border. And American plans to intensify the conflict in the border region could deepen the crisis.
The residents of Katcha Ghari camp are both angry and confused
Already the government is struggling to cope.
Thousands of homes have been destroyed by military operations, particularly in the tribal area of Bajaur.
The army has declared victory, saying it has won back territory from the militants. But this has been at a huge cost to civilians.
Many have fled to the camps, many more have squeezed in with relatives or rented cheap accommodation. They are not sure it's safe to return, and few have anything left to go back to.
Some of the tents in Katcha Ghari serve as makeshift classrooms. These provide a refuge from the conflict for children. Their schools have been targeted by militants, and used as bases by the army.
For girls especially, school is the plus side of homelessness. Bound by the conservative tribal culture, they are rarely educated.
But 12-year-old Samina Khanpur has just had the opportunity to finish kindergarten and enter first grade.
She remembers bombing raids, and cowers in her tent when planes fly overhead, but comes eagerly to learn her lessons.
"I miss my home," she says, "but the school is the one good thing about this place."
Otherwise camp life can be very difficult for women, accustomed to strict segregation from men who are not family members.
United Nations agencies have set up canvas walls around clusters of tents to give women more privacy.
We enter one of these with Zaman ur Rehman, a subsistence farmer who has two wives, 16 children and 20 grandchildren.
There are men in our party, so the women conceal themselves in one of the tents for the duration of the visit.
Mr Rehman tells us his home has been flattened. He considers himself lucky because it was bombed after he left, although one of his children died during the family's flight from Bajaur.
Camp life is hard, but he is not moving unless he gets government help.
"If there's peace we'll go back," he says, "but after all we've suffered, we should be compensated, so we can go and rebuild our houses."
That is the consensus in the camp.
"We can't do anything else," says a teacher, Abdul Haleem. "They've destroyed the whole village, the whole market. There are no hospitals, no schools, no teachers in Bajaur. They're all here."
Mr Haleem and the camp dwellers are angry with the military and confused. They tell me they do not understand a war that punishes civilians. They want the army to make peace with the Taleban, even defend the militants against the Americans.
"The Taleban have stood up against bombardment by US missile strikes, and the army should tell the Americans to stop this!" says Mr Haleem.
The government of the North West Frontier Province (NWFP) has appealed to the federal authorities and international donors to supply funds not only for relief, but return and rehabilitation.
Currently it is planning to provide services for the displaced until the end of the year, but by then, others could swell their ranks.
The children in the camp face an uncertain future
US President Barack Obama has declared Pakistan's border region the most dangerous place on Earth. It seems likely that conflict there will increase in the coming months, including more American missile strikes.
If so, "there will be more displaced people coming to this region", says the province's Social Welfare Minister Sitara Ayaz.
"We know how difficult it was when they first came and it still is for us. So it's a concern for us, if more people come here and if they are not going back, then it will be a very big problem. The crime rate could increase. When you don't have food and shelter, a lot of things happen."
It's already a big problem: recent clashes at another camp between police and protesters demanding compensation left one person dead, raising fears of further unrest if the displaced do not get money soon to rebuild their homes.
Mr Obama calls Islamic militancy a cancer that is destroying Pakistan from within. But for many of the tribespeople, the cure seems as deadly as the disease.