It was an honor typically reserved for government leaders, captains of industry and prominent figures in the arts and sciences. But in late November, the producers of "Face to Face," one of China's most popular news shows, invited an earnest young AIDS activist onto the program.

For years, Li Dan had labored to force the ruling Communist Party to address the country's worsening AIDS epidemic, risking arrest in a nation where the authorities regard activism of almost any kind with suspicion. But now the skinny 25-year-old was sitting in the studios of China Central Television, the party's most influential propaganda outlet, answering questions for a national prime-time audience.

Wearing wire-rim glasses and a leather jacket, he described the plight of the hundreds of thousands of Chinese peasants who had contracted AIDS through selling blood. He also told how he had opened a school here in central China for children who had lost parents to the disease. At the time, it seemed Li had persuaded the authorities to accept him and his cause.

Nine months later, Li sat for an interview with an American reporter. This time, his face was bruised and his eyeglasses were broken, and he described how thugs had beaten him up in a government office. Others had run his volunteers out of town. Local officials had shut down his school, physically dragging away students and arresting some of their parents. And fellow AIDS activists had accused him of pushing the government too far.

"It's been more difficult than I thought it would be," Li said, reflecting on his experiences in a soft, mumbling voice with the cerebral detachment of the former astronomy student that he is. "But it's like playing a game . . . and we're getting better at it."

The rise and fall of Li and the Dongzhen School for AIDS Orphans illustrates a broader struggle that has begun to reshape the world's largest authoritarian political system: a battle by a wide assortment of citizen groups to establish civil society and influence the government in a country where the party has long dominated all aspects of public life.

The party still tries to control all social organizations in China. But after a quarter-century of capitalist-style economic reforms, Chinese enjoy greater prosperity and personal freedom than ever before under Communist rule, and growing numbers are taking advantage of both to band together and campaign for causes as varied as environmental protection, an end to domestic violence and the preservation of Chinese architecture.

The party has said it welcomes the rise of these civic groups, recognizing that they can provide much-needed services as the government sheds the welfare commitments of its socialist past. But it has also expressed worry that they might threaten the party's monopoly on power, and it has tried to exercise control by setting up its own organizations, limiting the number of new ones that people can establish and requiring them to find government sponsors. At times, the party simply declares a group illegal and crushes it.

And yet it has not been entirely successful. Increasingly, China's non-governmental organizations find they can navigate around the party's controls, operate with a degree of autonomy and even influence public policy. But they routinely wrestle with difficult questions about how to live within the limits of the rigid Chinese political system: Does working with the government make you part of the solution or the problem? Does challenging it help or hurt your cause? And when are the costs of compromise or conflict too great?

"It's like being trapped in a room. You're limited in what you can do, and it can be very uncomfortable," said Wan Yanhai, one of China's first AIDS activists. "But then you do what you can, and find you can make the room more comfortable. You might even make it bigger."

A Hidden Epidemic

For five days in the summer of 2001, Li Dan explored the villages surrounding this small city in China's central Henan province, about 425 miles northwest of Shanghai. He learned how peasants lined up in the early 1990s to sell their blood to dealers who used unsafe collection methods -- and how hundreds of thousands contracted the AIDS virus as a result.

He met villagers who had lost more relatives to the disease than they could recall, and men barely his age who lay in bed dying, their gaunt bodies wasting away. One photo Li saved shows him standing next to an elderly farmer in front of a large mound of yellow-brown dirt. People had refused to help the farmer bury his 30-year-old son because he had died of complications from AIDS. So the old man had wrapped the body in a bamboo mat, carried it on a 15-minute hike to his watermelon field and put it into the ground himself.

"There was something about that grave I never forgot," Li recalled. "It was haphazard and messy, and it didn't look like a grave at all."

Li was 23 then, a doctoral student in solar physics at the prestigious Chinese Academy of Sciences and a member of the Communist Party. Growing up in Beijing, he had learned little about AIDS. But in college, he saw a bootleg version of the American film "Philadelphia" and began working with Wan, the pioneering AIDS activist.

After the trip to Henan, sick villagers began coming to Beijing and calling Li for help. He was confident he could make a difference, perhaps because of all the propaganda films he had watched as a child, he said. But as the scale of the epidemic dawned on him, Li concluded that "only the government has the resources and the money to help these people. . . . The idea was to push it to act by drawing attention to the situation."

In 2002, he borrowed a video camera, filmed a documentary about an AIDS-stricken village in Henan and delivered it to the Health Ministry. When he distributed the footage to journalists, police detained him for a day and issued a warning. But months later, the Health Ministry announced a project to help the village that was the subject of his film.

Soon afterward, over the objections of his parents and his girlfriend, Li gave up his doctoral studies to pursue a career helping people with AIDS. At first he worked with Wan, helping him expose the epidemic in Henan. But he grew frustrated by the slow pace of progress.

"We were trying to lead, but the government wouldn't follow," he said. "We would expose the problem in one village, and the government would respond, but only in that village. It wouldn't admit the larger problem."

Last year, Li parted ways with Wan to try a different approach. If he couldn't help the peasants with AIDS, he decided, perhaps he could help their children.

A Daring Move

Li named his project Dongzhen, or "eastern treasure." The treasures were children who had lost their parents to AIDS. His plan was to start an orphanage.

But a civil affairs official in Shangqiu told him he could open an orphanage only if he turned over any funds he raised and let the city run it. When Li asked how he could guarantee the money would be spent properly, the official responded, "Don't you trust the government?"

Li did not. But instead of giving in or giving up, he made a daring choice, starting the orphanage without official approval. He borrowed money from friends, rented an apartment in Shangqiu and took in two young boys from nearby villages. In effect, he was playing chicken with the state. "I thought if I could get it started, and it got attention, the government wouldn't shut us down," he said.

Two months later, the public school he had planned to send the children to refused to accept them. Li said the principal was worried parents would be afraid their children would contract AIDS from the orphans.

So Li weighed the risk and made another daring move: He started his own school. He rented an empty building at a mosque that had a sympathetic imam, calculating that the mosque, which was officially sanctioned by the party, might offer him protection from local officials opposed to his project.

On Oct. 24, 2003, the Dongzhen School for AIDS Orphans opened. There were four teachers and 17 students, ages 7 to 12, all of whom had lost at least one parent to AIDS and whose families could no longer afford to send them to village schools. More children arrived later, bringing the total to 23.

Journalists soon flocked to Shangqiu. China Central Television sent two crews, several newspapers published stories and a magazine run by the Communist Youth League named Li one of its young volunteers of the year and put him on its cover. The publicity led to a stream of donations, and college students across the country volunteered to help.

Buoyed by the support, Li began to believe he could succeed and met with a Shangqiu official in mid-February about getting the permits to run a private school. Li said the official, Cheng Youxin, was enthusiastic, and promised to give him all the permits he needed if he managed to raise about $120,000.

Li left the meeting surprised and excited. A month later, he met with several potential donors in Shanghai, including one who said she was willing to put up the $120,000. He invited them to Shangqiu, where he planned to take them to meet Cheng to close the deal.

A Sudden Blow

But on March 18, the day before the donors were scheduled to arrive, police cars pulled up and a team of government officials entered the school, an aging concrete building with seven bare classrooms. Li said a district party chief, Han Xiuying, handed him a notice declaring the school illegal and ordering him to shut it down. Li was stunned and tried to talk her out of it. "I always knew they might do this," he recalled, "but I never imagined they would do it after letting us get so close."

The teachers and students were surprised, too. Children fled to a second-floor classroom, where some of them tried to spit on the officials below, witnesses said. Volunteers pleaded with the officials. "We were agitated because the donors were coming the next day," said Liang Yanyan, 23, one of the volunteers. "We said if you do this now, the school would lose the funding and it would be the children who were hurt."

But the officials demanded the children be turned over and taken to a state orphanage. Li and his colleagues could see the children crying on a bus as it pulled away.

Later that evening, an official at the mosque told Li and the others that local authorities had shut down the school because it made them look bad. It drew unwanted attention to the AIDS epidemic and raised questions about why the children couldn't attend public schools, he told them.

The next day, when the donors from Shanghai arrived, local officials greeted them at their hotel and took them on a tour of the state orphanage, one of the donors said. The officials told them Li's school had been operating illegally and pressed them to give their donations to the government instead.

Li managed to meet with the donors later, and some expressed doubts about the government's story, but it was too late. None gave him any money.

At first, Li was discouraged. But then he considered what he had already accomplished -- Dongzhen had raised more than $20,000, and it had attracted nearly a dozen volunteers to the school and 300 other supporters on the Internet -- and he resolved to push ahead.

He spent the next few months in Beijing trying to register his organization with the government and make it legal. Eventually, he registered it as a private business, taking advantage of the party's more liberal attitude toward economic freedom.

In late June, Li returned to Shangqiu and pleaded with officials to let him reopen the school, even offering not to give any more interviews to journalists. But one official explained the bottom line: City leaders didn't want an AIDS school in Shangqiu.

Li told him he wouldn't give up, and quoted one of Mao Zedong's sayings: "To struggle against heaven, earth and man: What joy!" The next day, June 21, he began holding classes at the mosque again, with another group of children.

Eviction and Arrests

Two weeks later, a delegation of local officials visited the school and told Li and his colleagues they were not welcome. A county AIDS official, Zhang Zhongyin, claimed the school had hurt the community's image and damaged its economy by making it difficult for its migrant workers to find jobs. Li calmly debated the officials for hours until they grew exasperated and left.

"Li Dan is not welcome by the local government or the local people," Zhang said when reached by phone. "He just wants to raise money by destroying our reputation."

Days after the meeting, the mosque evicted the school, and Li moved the children into a dormitory across the street. The next day, he left to attend a workshop for AIDS activists in Thailand. While he was away, the government made its move.

At 9 p.m. on July 9, dozens of local officials converged on the dormitory. Li's colleagues said they urged the officials not to scare the children and promised to return them to their homes the next morning. But the officials refused and began grabbing the 21 children.

Fan Huili, 15, said he ran and hid in a closet. Wang Fenjuan, 14, said she was getting ready for bed when three men entered the room and carried away one of her classmates. Then another man seized her wrist so forcefully he left a bruise. "I tried to get away," said Zhu Yadong, 13, "and then two men came and they each grabbed one of my arms."

But someone had tipped off the children's parents, who arrived just in time. They confronted the officials, demanding to know why the school had been closed. "They were trying to throw our kids into their cars, and the children were crying," said Wang Guofeng, 43, one of the parents. "I said, 'It's illegal for you do to this!' "

Other parents said they scuffled with the officials, shouting that they had AIDS and threatening to bite them. That apparently frightened the officials, who quickly retreated.

The next morning, a local official purchased breakfast for the families and promised to provide their children with free schooling if they returned home. The parents agreed.

But the official did not keep the promise. Instead, two days later, police arrested two HIV-positive parents who had been among the Dongzhen School's strongest supporters: Wang and his wife, Li Suzhi.

Weighing Compromise

The arrests caught Li Dan off guard and shook his confidence. Wang and his wife had been critical to Dongzhen's success, because they had persuaded frightened villagers to send their children to the school. Now Li worried they were being mistreated in jail and denied the antiretroviral medicine they needed to take daily.

He was unsure what to do next and wondered whether he had gone too far. Li had always recognized he might be arrested for his activities, but he never imagined local officials might punish the sick and impoverished people he was trying to help. "Of course, I feel some guilt," he said one day, hesitantly. "We're safe, but we put them in danger."

In Beijing, he turned to other activists for advice. On July 31, they had an emotional debate over whether Li had recklessly endangered the couple by reopening his school.

Jason Su, a Salvation Army official who works in Henan, told Li he should have considered other projects after the government closed the school, and argued that Wang should have stayed away from him. "Your school was illegal," he said. "You refused to close it."

But Wan, Li's former mentor, reacted angrily, arguing that it was the government that had been reckless. "You're wrong," he snapped at Su. "You're criticizing the weaknesses of villagers who have been jailed and helping the local government justify their illegal actions."

The next week, Li found his footing again, launching a petition drive on the Internet for the couple's release and printing a large set of postcards with their photographs. He also took Wang's father to appeal for help at the offices of several government ministries in Beijing.

The strategy appeared to alarm the local government, which sent officials to Beijing to stake out government buildings and try to seize Wang's father. Then, on Aug. 7, police released the couple on a type of probation. Li was relieved, and embraced the couple when he saw them.

But his enemies weren't finished. Two days later, three men approached Li in Shangqiu and began punching and kicking him in front of a crowd, witnesses said. Police eventually stopped the fight, but Li said they took no action against his assailants.

That night, a posse of large men also forced Li's volunteers out of their apartment. They identified themselves as local residents angry that AIDS had been brought to their neighborhood, and they threatened to hurt the volunteers if they didn't leave town. Again, police refused to intervene.

Then, on Aug. 23, two of Li's college-age volunteers were beaten and robbed as they attempted to distribute money to AIDS families. The incidents led other AIDS activists to accuse Li of pushing the government too far. Even Wan issued a tough statement suggesting Li had put his volunteers in danger.

Li appeared frustrated and tired, but also strangely calm in the face of such attacks. Without even raising his voice, he said it was understandable for people to question his tactics.

A few days later, he and two colleagues went to see government officials outside Shangqiu in an attempt to make peace. But a township chief intercepted them and asked them to leave. When they refused, several men entered the room and began pushing, shoving and punching them, Li said. One knocked off his glasses and stomped on them. The township chief watched the fight, and asked Li to leave again, saying he could not guarantee his safety.

Though his face was bleeding, Li laughed and insisted on staying until the police arrived. He said he was angry, but mainly didn't want to give in.

That night, Li said, he received a call from Zhang, the county AIDS official, who asked what it would take for him to keep the incident quiet. The two men arranged to meet, and Li told him he just wanted to work in Shangqiu again.

Zhang replied that Li needed to demonstrate sincerity and suggested he take three steps: Change the school's name, write a letter of apology to city leaders and pledge not to contact the media again. But Zhang refused to say if the city would do anything in return, Li said.

Li agonized over how to respond. Once again, he was forced to confront the tough questions that all civic activists in China face about their ambiguous relationship with the government. Li was reluctant to compromise but believed he had to make some gesture, if only to demonstrate his reasonableness to his critics. "We have to stand up for our just principles, but we also have to find a way to do our work," he said.

Li decided he was willing to change the school's name and even to cut off contact with the media, but he drafted the letter carefully. He apologized for the trouble his insistence on media coverage had caused local officials, but he also wrote that such reporting raised awareness of AIDS. And he included a sarcastic passage apologizing for forcing the city to waste resources on protecting him from violence.

Li sent the letter to Zhang last week. He has not received a response. "I doubt they'll accept this letter," he said, "but as long as there is a chance, I have to try."

Researcher Zhang Jing contributed to this report.

Li Dan, center rear, opened the Dongzhen School for AIDS Orphans without official approval and staffed it with volunteers before it was closed down.Li Dan said party officials first approved, then opposed, his school for AIDS orphans. "It's like playing a game, and we're getting better at it," he said.