GUANGZHOU, China -- As he waited to give blood for an H.I.V. test one recent afternoon, Le, a 25-year-old marketing professional, explained why he was there. "I was aware of the consequences" of not using a condom, he said, "but somehow I didn't know how to say no."
Le, a gay man who would give only his first name, was being tested at the Lingnan Health Center, an organization run largely by gay volunteers, whose walls are adorned with red AIDS ribbons and a smiling condom mascot. In the past, Le went to hospitals to be tested, he said, but the stigma of being a gay man in China made the experience particularly harrowing.
"I'd always be concerned about what the doctors would think of me," Le said. "Here we're all in the same community, so there's less to worry about."
Le is one of thousands of gay men in this bustling city of 13 million people who are benefiting from a pioneering experiment that supporters hope will revolutionize the way the Communist Party deals with nongovernment groups trying to stop the spread of AIDS and other sexually transmitted diseases.
Encouraged by the new slate of leaders who came to power in November, civil society activists hope the model taking shape here in the prosperous southern province of Guangdong, which has long served as a petri dish for economic reform, will be replicated nationally, not just in the fight against disease but also on issues like poverty, mental health and the environment.
While China's Center for Disease Control and Prevention has allowed community organizations across the country to participate in disease testing programs since 2008, in practice those efforts remain patchy. But in November, just before World AIDS Day the following month, the grass-roots movement received a high-profile endorsement from the incoming prime minister, Li Keqiang.
At a meeting with advocates for AIDS patients, Mr. Li, a large red ribbon pinned to his jacket, promised more government support and shook hands with H.I.V.-positive people. The image resounded in a society where those infected are routinely turned away from hospitals and hounded from their jobs. "Civil society plays an indispensable role in the national battle against H.I.V./AIDS," he said, according to the state news media.
Activists remain wary, however, noting that the government has made similar promises in the past. And despite the high-level support and a policy in Guangdong allowing grass-roots groups to register directly with the government -- instead of being forced to find an official sponsor, as in much of the country -- many organizations say they still are stymied by dizzying bureaucratic hurdles or rejected for missing unannounced deadlines.
Tao Cai, the director of AIDS Care China, which provides support to 30,000 H.I.V.-positive people nationwide but remains unregistered, believes the obstacles come from local officials who are trying to prevent nonprofit groups from competing with their fiefs. "In China," he said, "we say reform never gets out of Zhongnanhai," a reference to the walled compound for senior leaders in Beijing.
There is little doubt that public health officials need help. Through October, nearly 69,000 new H.I.V. infections were reported in China in 2012, a 13 percent rise from the same period in 2011. Almost 90 percent of those cases were contracted through sexual intercourse, with rising numbers involving gay men. Medical experts also worry about syphilis, which has returned with a vengeance after being virtually wiped out during the Mao era.
Reported cases of syphilis, known in the south as "Guangdong boils," have increased more than tenfold in the last decade, according to national statistics. As with H.I.V., gay men and sex workers are particularly at risk. Local health experts estimate that 5 percent of men who have sex with other men carry H.I.V., while around 20 percent test positive for syphilis.
The Chinese authorities have long tackled the rise in communicable diseases among gay men with all the sensitivity of a swinging billy club. In raids on bars, bathhouses and parks, police officers and health officials often force those detained to hand over their IDs and submit to blood tests.
Grass-roots health groups have been frequent targets of official harassment as well. In most provinces, they can legally register with the Bureau of Civil Affairs only if they are sponsored by a government agency. But advocates say few agencies are willing to vouch for groups focused on politically fraught issues like homosexuality, prostitution or sexually transmitted diseases.
In the face of such constraints, the majority of China's estimated 1,000 H.I.V. organizations operate in a legal purgatory that deprives them of tax benefits and makes it risky to accept foreign donations, usually their main source of support.
Mr. Li, the incoming premier, has a spotty record when it comes to H.I.V. In the 1990s, when he was the top official in central Henan Province, a botched blood-collection program there infected hundreds of thousands of people with H.I.V. Critics say Mr. Li was more interested in covering up the problem than dealing with its causes. Even as he was holding court with AIDS groups, over a hundred of those infected in the scandal marched in Beijing to the Ministry of Health demanding justice.
Mr. Li's views appear to have changed. In November, social media erupted over the case of a 25-year-old man seeking treatment for lung cancer who was turned away from two Beijing hospitals because he was H.I.V.-positive. A hospital in nearby Tianjin finally removed the tumor -- but only after he altered his medical records to conceal his H.I.V. status from doctors. As a battle raged online between those condemning his actions and those sympathizing with his plight, Mr. Li ordered the Health Ministry to prohibit hospitals from rejecting AIDS patients.
For the vast majority of Chinese, AIDS remains a fearful issue. People who get infected with H.I.V. often become social outcasts, a situation made more perilous by the absence of legal protections for those who lose their jobs or their homes.
After he came out as gay and H.I.V.-positive on Chinese television in 2005, an artist who goes by the pseudonym Da Wei was promptly fired. Then he was evicted from his apartment by his landlord -- a doctor -- who showed up at his door with printed images of his face from TV. "He said he had no problem with my health condition, but what would the other tenants think?" the man recalled in a phone interview.
Even medical professionals who work with AIDS patients are not immune from discrimination. "Other doctors are afraid they'll catch H.I.V. from my lab coat," said Chen Xiejie, the vice director of infectious diseases at the Guangzhou No. 8 People's Hospital. "If I go to their offices they say, 'Don't sit down.' They won't even shake my hand."
The Lingnan Health Center, a comfortable space decorated with couches and a fish tank, strives to be more welcoming toward the dozens of gay men who come each day to roll up their sleeve and learn their fate. If they get bad news, patients can return for counseling and information on medical treatment.
"We want it to feel like home, not a hospital," said Meng Gang, Lingnan's founder.
The center's employees say unsafe sex is all too common among those tested, a result of deeply closeted lives.
"With gay men the sex is all underground," said Xiao Mi, a Lingnan staff member.
According to Mr. Meng, most gay men will forgo condoms rather than challenge a partner who says he is not infected with H.I.V. "It's an issue of face," he said.
Mr. Meng founded Lingnan five years ago as a health-focused offshoot of his gay advocacy organization, Guangtong, which offers services like sex education, counseling on coming out, and online dating through its Web site, which receives around three million visitors a year.
Guangtong delves into a realm the Chinese government prefers to keep shrouded. Homosexual characters are banned from television, gay film festivals cannot advertise, and the police often force lesbian and gay organizations to cancel programs during politically delicate events.
Despite the state-sanctioned prejudices, Chinese health officials say cooperation with grass-roots organizations is beginning to transform the government's approach to such issues.
"The fight against S.T.D.'s is not just about public health," said Yang Bin, the director of the provincial sexually transmitted disease control center. "It's a political issue, too."
Shi Da and Mia Lee contributed research from Beijing.
Correction: January 2, 2013, Wednesday
This article has been revised to reflect the following correction: Because of an editing error, an earlier version of a picture caption misspelled part of the name of an organization in Guangzhou. It is the Lingnan Health Center, not Lignan.
This article originally appeared in The New York Times.