Since the 1950s, China's residence permits have controlled where people live and allowed them to move only with special permission. Peasants were supposed to stay on their farms and urban workers in their towns. But today millions of workers seeking jobs are skirting official policy and creating their own ad-hoc communities on the urban fringe. China's cities are growing by an average of 3 percent a year, and the government says there are at least 70 million migrant workers and transients who have moved to the cities. Western analysts quote numbers as high as 200 million to 300 million.

Expecting to earn higher wages selling vegetables in Beijing, Li Shumei left her teaching job in the middle of central China's Hennan Province. But because few could afford the high tuition the established schools charged families without permanent residence, other migrants pressed Ms. Li back into service as a teacher. She opened the Xingzhi school in 1994.

At first there were only a handful of students. But a year later, Li's husband, Yi Benyao, left his job as granary manager in the countryside to become principal for the growing school.

At Xingzhi, classrooms packed with 50 students are heated by a single small coal stove that does little to ward off the cold in the winter. Children practice a traditional fan dance outside on a raised cement block, their only stage. The textbooks are dog-eared, fourth-generation hand-me-downs.

The school's meager resources force it to make do with a motley crew of volunteers and teachers - only a few of whom are certified. Most, like the children, have come from other regions looking for opportunity.

With tuition costing $80 per semester, parents who earn about $120 a month can just afford it. But even that isn't enough to cover costs: Only Mr. Yi's shell game with the school's finances keeps it afloat.

Despite the built-in disadvantages at Xingzhi, test scores are comparable with other schools, parents say approvingly. And, as Li Zhondong, a bottled-water deliveryman who enrolled his 11-year-old boy, points out, "the quality [of the education] here is much better than in my hometown."

Demand for the school's services continues to grow. Local media reports have drawn more parents, desperate to keep their families together without sacrificing education. Restaurant worker Zhao Lijun waited three days to find out if her 11-year-old twins could enroll after she heard a news broadcast about the school. "Those days felt like years," she says. Now her daughters are thriving and have bright visions of the future. "I want to be a famous singer and movie star, and make lots of money, and take care of my parents, and make my hometown beautiful," says Jing Meilin, the younger of the two button-nosed, identically dressed sisters.

"More and more families are coming," says Yi, the principal, who dresses like an old cadre in a blue Mao suit, with layers of sweaters underneath.

THE current situation is the harvest of a policy instituted to prevent the mass migration sparked by industrialization in the 1950s. Urban dwellers were guaranteed healthcare, food, housing, jobs, and access to higher education. Peasants were on their own, becoming "a kind of modern serf," says a former government agrarian economist. During the famines of the 1958-60 Great Leap Forward, only those with valid residency permits received food rations.

Collectivization and attempts at self-reliance within the communes depressed harvests so much that some local governments gave peasants special passes to beg in the cities. In 1978, the government relented, dismantling communes. Productivity doubled, and the rural economy boomed.

But in the '80s, while cities continued to prosper, average rural income fell to half that of urban income. Migrants began moving to the cities for higher pay and to feed the growing demand for unskilled labor.

In the cities, outsiders were blamed for rising crime rates and wage deflation. Local governments confined migrants to menial labor. But when workers head home during holidays, for example, the growing reliance on migrant labor becomes obvious. Construction grinds to a halt, and Beijingers find that the cheap labor that made services like home milk delivery and maids affordable also disappears.

Despite the cities' hunger for cheap labor, migrants are still barred from settling permanently. They live in shanty towns organized by village on the outskirts, without running water or electricity.

The flow is expected to increase once China joins the World Trade Organization and freer agricultural imports cut into farmers' wages. "The prospects for rural labor are dimmer now than they have been in the last decade," says Steve McGurk, a researcher at the Ford Foundation in Beijing.

The central government has promised change and has begun consulting with the World Bank. China's fear is the creation of the kind of mega-slums that encircle Mexico City and the social unrest they could foster. "The central government is not hidebound," says Songxu Choi, an urban economist at the World Bank in Washington. "Top policymakers have decided that the whole policy has to go."

The Xingzhi primary school has yet to see the results of that decision. Officials say they will legalize the school, but keep delaying the paperwork. In the meantime, Yi is faced with a new problem: Graduates from his primary school are reaching middle-school age. A consortium of migrant-workers schools has decided to form its own middle school, and held its first class with 37 students last year.

The measure only postpones the problem until the students find themselves unable to enter high school and then college, because their diplomas are not officially recognized.

People like Zhang Shunhua, a father of two, remain determined. "I'll pay all costs to send my children to university," he says. "I dropped out in the third grade because my mother died. I want my children to escape from this illiteracy."