BEIJING Close to sunset, the Chinese national flag above Peach Garden School cast a long shadow on the muddy ground. Thirteen-year-old Li Jianrou, the daughter of migrant workers from Hebei, still lingered with friends in their ramshackle classroom. A peek into her home, just a minute away, soon reveals why the fifth-grade student spends all her spare time at school.

The tiny room in northwest Beijing contains little besides her parents' bed, which they share with Li's younger brother, and her own bed, separated from theirs by a torn curtain. Several migrant families occupy homes around this run-down courtyard rented from local farmers. Some recycle rubbish, others -- like Liu's parents -- hawk crafts at a nearby market. All are grateful for the dirty jobs increasingly spurned by China's city-dwellers.

It is a far cry from the capital Li dreamed of when her parents deserted their ancestral village in pursuit of work and a better life. Left behind with her grandmother, Li longed to see Tiananmen Square, skyscrapers, bustling streets and other incredible sights. "I couldn't bear to live without my children," mother Qiao Jiping explained, "but I couldn't just let them hang around without schooling."

The 2,000-yuan sponsorship fee to enter a state school postponed plans to reunite the family, until Qiao heard about Peach Garden. Founded specifically for migrant children, the school charges only 300 yuan per semester.

"I am so grateful," Qiao said, although daughter Li remains less impressed by the Beijing she found. She has visited Tiananmen once, but overall, she said, "It's not as much fun as I expected."

At least Li has a school to attend. Access to education is one of the biggest obstacles facing the migrant workers who are transforming cities nationwide. This "floating population" of up to 100 million is a key factor in China's transition from a rural to an urban society and from an agricultural to an industrial economy. Sending up to 50 percent of their earnings home, migrants play an important role in spreading wealth down to the villages. Yet they are still treated like second-class citizens by a system so discriminatory it has been likened to apartheid.

Former leader Deng Xiaoping abolished Maoist restrictions on internal travel in the early 1980s, but social mobility in China remains inhibited by a residence-permit system tying health, housing and education to employment by a state-owned enterprise. Before 1996, migrant children were not even permitted to attend state schools, despite the constitutional promise of compulsory education.

After the Ministry of Education finally conceded responsibility for migrant children, state schools reluctantly opened their doors -- only to charge high fees that few migrants can afford. Illegally founded migrant schools have been clashing with the authorities ever since.

Zhang Ailing, the 36-year-old founder of Peach Garden, is an accidental convert to the cause. A migrant from Shandong, she came to Beijing to work as an accountant for a relative's company. In early 1997, she chanced upon a television documentary detailing the plight of a migrant school named Xinzhi, which was built on a vegetable patch in Beijing's Fengtai district. Zhang was so moved by the story that she volunteered to work there.

It was a baptism of fire. On the very first day of her teaching career, as she stood nervously before her class, policemen arrived to demand the school be shut down. Zhang accompanied Xinzhi's principal to reason with local government departments. Due to increased media exposure, and the efforts of some National People's Congress delegates, the central government decreed in May 1998 that migrant children should mainly rely on state schools for their education, but that it could be supplemented by other kinds of schools.

However, detailed implementation of this regulation is at the discretion of local authorities. To date, only a handful of cities, such as Wuhan and Guiyang, have granted legal status to migrant schools. The Spring Bud School in Wuhan, where over 2,000 pupils are enrolled, is the largest in the country.

Grateful for the breathing space, Xinzhi flourished thanks to ever-rising demand. Teacher Zhang decided to set up her own school for migrants after studying various migrant neighborhoods.

"I was horrified to see women hawking fake computer software tailed by their school-age children as old as 9 or 10," she said.

She chose Beijing's Sijiqing district because of its large migrant community. From 59 pupils in the first month, she now has over 300, divided intosix grades and crowded around wobbly wooden desks that Zhang rescued from a state-school dump. Despite the complete lack of financial aid, she tries to provide high-quality teaching, using the same curriculum as state schools and offering 15 courses from English to computer studies.

Peach Garden's unofficial status, in a country still hidebound by bureaucracy, ensures a succession of troubles. Some children living far from the school commute daily by bus. But to obtain a discounted fare, like the one local children pay, the school must apply with an official chop, which it is not allowed to produce.

"They are all children, but why do they have to be treated so differently?" complains Zhang.

For over a year, she was unable to offer any pupil a Young Pioneer's red scarf, a symbol of distinction, until the youth-league organization of Beijing Normal University took the school under its wing in November 1999.

"Of course, the school's legal status is my biggest worry," admitted Zhang. "But no one can say I violate the country's constitution. Every child has a right to education."

Bai Wenyu, researcher for the Ford Foundation's project on the education of migrant children, has visited 114 migrant schools in Beijing over the last two years. Ranging from just nine pupils to over 1,000, about half were established in the more tolerant environment of 1998.

"Before my research began, I didn't even know such a thing as migrant schools existed," the 29-year-old BNU postgraduate admitted.

Bai estimates there are currently 200 to 300 migrant schools in Beijing. The number is still growing to accommodate over 100,000 migrant children aged between 7 to 15.

Educational levels among migrant-school founders vary greatly. Bai Wenyu encountered both extremes, from a master's-degree holder from Beijing University to an illiterate peasant.

"I never went to school myself because my family was too poor" explained Chen Fuyao, previously a foreman at a Beijing construction site. He never used a quilt as a boy, but could only cover himself with straw. "The main reason I set up Jingyuchen primary school was that I couldn't afford to send my two children to school here, but I wanted them to get some education."

The more schools Bai saw, the more sympathy he felt toward disadvantaged children.

"It would be extremely unfair if the government really decides to ban migrant schools to force [these children] into expensive local schools. I know how hard it is for their parents to make a living here," he said.

As municipal governments move to restrict further the kind of jobs migrants can "take" from local residents, many remain stuck in low-end jobs such as garbage collection. Local Chinese newspapers have likened the squalor of migrant areas to the Victorian London depicted in Charles Dickens' novels.

For a number of concerned scholars, legalizing migrant schools is not enough. What worries them more is the long-term negative impact of such segregation, under which the new generation of migrants may never grow out of their "slum culture."

"It is effectively apartheid," pointed out Zuo Xuejin, a senior professor from Shanghai's Academy of Social Sciences. "We laugh at America's racial discrimination, but how can we create a new system of apartheid in the 21st century, in communist China, where everyone is supposed to be equal?"

A drop in Shanghai's birthrate has left many state schools with insufficient pupils, yet some charge migrant children high fees or even refuse to accept them at all. Zuo has written to Shanghai's education authority urging that all schools open their doors to everyone. If they have to charge, the government should set a standard, affordable fee. "We should educate parents who don't want their children to sit in the same class as migrant children that it is in their own interests to have a mixed class," he said.

He argues that such segregation will only increase urban children's sense of superiority over their migrant cousins. Their outlook will be narrowed by exposure only to their own kind of people, and they will have little concept of how hard life can be.

Some Chinese analysts point out striking similarities between discriminatory policies practiced in the United States early last century and China's contemporary treatment of its peasantry. Victor Yuan, president of the market-research firm Horizon, first raised the concept in a 1995 report on internal organization among migrant workers.

"It is so unhealthy to live such a segregated life!" Yuan exclaimed. "One negative effect is to foster hostile feelings between locals and migrants."

Nicknamed the "migrants' spokesman," Yuan says his advocacy of migrant rights stems from being an outsider, too, born to peasants in Jiangsu Province. Convinced that migrants represent an important force for social progress, Yuan has conducted a Ford Foundation-sponsored project since mid-1997 to promote better understanding and communication between locals and migrants.

At Datun Xiang, just north of Beijing's Asian Games village, almost 35 percent of the 4,000 residents were migrant workers, mostly garbage collectors or hawkers. Horizon staff stationed in the area produced monthly newsletters and organized community activities like tea parties or children's games. Slowly, both sides overcame their caution and began to participate.

However, after three major crackdowns by the local government, few original migrant families remained in the community. Some were driven back to their home provinces, while others found refuge elsewhere in Beijing.

"It's something beyond our control," said Yuan. "Yet it was still a meaningful experiment."

Responding to charges that migrants are respon- sible for the rising crime rates in China's cities, Yuan acknowledged, "They sometimes steal manhole covers or even destroy public property like public phones. But if they feel they are part of the community, they are less likely to commit such crimes."

The Horizon research uncovered psychological problems among migrant children, such as depression, low self-esteem and antisocial behavior. Yuan suggests that the problems stem from losing the beauty and space of life in the country without the compensation of urban facilities. With poor living conditions, little attention from busy parents and rubbish dumps for playgrounds, the children are extremely unkempt in appearance. Local children enjoy a richer material life and are often warned by their parents to stay away from anyone who is "dirty."

While children react sensitively to such discrimination, Yuan also noticed how well they served as bridges between adults during community activities.

Naturally, not all government officials support such projects. If more local communities and schools are open and welcoming, they fear, even more peasants will be attracted to the cities. The floating population, currently a convenient scapegoat for all social ills, is sometimes described as a "powder keg" waiting to explode. Prosperous cities like Beijing and Shanghai have drafted new rules prohibiting migrant workers from any but the simplest jobs. It is little wonder local governments have been dilatory in drafting regulations on the legal status of migrant schools.

In the face of stark inequality, China's migrants return to their greatest asset, a Maoist spirit of self-reliance. Anhui migrant Li Cuilin and her husband run a wholesale business selling noodles from their small home-cum-warehouse behind Beijing's west railway station.

"With only a few years education, what else can we do?" asked Li. Rising before dawn to secure the day's stock, she draws the strength to keep going from her determination to send her 7-year-old son to a good state school.

"We can tighten our belts to eat less, but without a good education he will end up just like us."