SAN FRANCISCO, JUNE 24 -- Hundreds of protesters armed with whistles and air horns took control of the Moscone Center today, drowning out Health and Human Services Secretary Louis W. Sullivan as he delivered the closing address at the Sixth International Conference on AIDS.

Enraged by the U.S. government's restrictions on immigration of people infected with the human immunodeficiency virus (HIV) that causes AIDS, the demonstrators pelted Sullivan with condoms while chanting "Shame, Shame, Shame."

The deafening chorus capped an extraordinary closing session at which some of the world's most eminent public health officials denounced the U.S. policy as needlessly discriminatory.

"How can we expect the private person to behave in a rational and responsible way . . . when states set a bad example by instituting irrational laws towards HIV-infected people," said Lars Kallings, president of the International AIDS Society in a speech delivered to the 5,000 assembled delegates just before Sullivan was introduced.

Throughout the week, protests staged by the AIDS Coalition to Unleash Power (ACTUP) overshadowed the scientific sessions here. But never was the anger and frustration over U.S. policy more in evidence. Four of the seven speakers at the closing ceremonies wore red armbands to signify their commitment to ending AIDS-related discrimination.

Despite noise so loud that speech was virtually inaudible, Sullivan delivered his entire address. As he spoke, a sea of protesters stood on their chairs and held aloft bright yellow signs saying "Turn Your Back." Sullivan's words were intelligible only because the woman standing next to him interpreted his remarks in sign language for the deaf.

The demonstration was led by members of ACTUP, some of whom paid the several-hundred-dollar registration fee to become a delegate. But many registered delegates turned their badges over to AIDS activists today so that they could enter the hall. Entrance has been tightly controlled all week because officials expected demonstrations.

Neither convention security officials nor any of the several thousand non-protesting delegates appeared to try to quell the uproar today.

"We obviously would have liked to hear what Dr. Sullivan had to say," said Paul Volberding, co-chairman of the conference and director of AIDS at San Francsico General Hospital. "That is why we invited him here, and it is too bad he was unable to be heard."

The United States has prohibited immigration by any individuals with HIV disease since 1987, when Congress passed a law adding it to the list of communicable diseases for which persons may be refused visas.

Since that time, federal health officials have insisted that there is no public health basis for the law, but efforts to change it have been stalled by battles between the Bush administration and Congress.

To demonstrate their opposition to the restrictions, nearly 100 international medical organizations and several countries boycotted the meeting.

ACTUP had planned a demonstration against Sullivan all week, but few thought he would be unable to make himself heard. The prepared text of his remarks was distributed to reporters this morning by his staff, because, they said, he might not be able to deliver the speech.

"Let us not turn our frustration to theatre searching for protagonists and antagonists," Sullivan said. "We must find the ways and means to work together for the benefit of people with AIDS and HIV infection throughout the world." He did not mention the immigration issue.

"More harm would have been done to Sullivan and the administration if people had heard his speech," said Jeffrey Levi, a Washington-based lobbyist for the Gay Men's Health Crisis. "Then they would have heard how little the administration has done to respond to the needs of people with AIDS."

Administration officials defended Sullivan, pointing out that he was not responsible for a law Congress passed.

"It showed extraordinary courage by the secretary to speak," said Kay James, HHS assistant secretary for public affairs. "It showed his commitment. His message is: 'I will not be silenced on this issue.' "

Even as Sullivan's address showed the continuing divisions between AIDS activists and the federal government, the administration's chief AIDS researcher, Anthony S. Fauci, received a standing ovation for his address to the assembled crowd.

Fauci has managed to appease activists with promises of rapid access to experimental drugs, while at the same time directing the federal AIDS effort that groups such as ACTUP have repeatedly found inadequate.

"Scientists do not need to adhere to every suggestion made by activists because some may be misguided," said Fauci. "However, scientists themselves do not have a lock on correctness. . . . We must join together, for together we are a formidable force with a common goal."

Despite the political tone of the meetings, the conference also bore witness to a series of promising advances in AIDS drug development and vaccine research made in the past year.

Data presented at the conference showed that scientists have a far better understanding of how to design an effective vaccine than they did even a year ago. Although it could be as long as a decade before there is a vaccine for humans, until recently many researchers doubted one could be developed at all.

The conference, which at times seemed more a carnival than a scientific assembly, ended on a day in which nearly 300,000 gay men and lesbians filled the city's streets to celebrate Gay and Lesbian Freedom Day.

Beginning early with hundreds of lesbian women on motorcycles -- who call themselves "Dykes on Bikes" -- racing up Market Street in a caravan of at least half a mile, the parade was joyous and informal, unlike the angry protests that marked the meeting.

There was no anger, no protest, only flamboyant -- and often lewd -- displays of happiness and affection. Bright rainbow-colored flags snapped from what seemed like every window in the city as thousands of marchers, including men in high heels and women in combat boots paraded toward the Castro District to celebrate.

Next year's conference will be in Florence, Italy. "The city is always open to everyone who comes," said Giovanni Rossi, chairman of that meeting.