A federal appeals court ruled Tuesday that the Bush administration can deny funding to nonprofit AIDS groups that don't publicly disavow prostitution and sex trafficking.

Overturning a lower court's decision, the U.S. Court of Appeals for the District of Columbia said that the AIDS groups' free speech rights would not be violated if the money was linked to a pledge to uphold government policy.

At issue is the case of DKT International Inc., which provides family planning and HIV/AIDS prevention programs in 11 countries. The group has refused to sign a pledge to oppose the policies because it helps distribute condoms to prostitutes and other sex workers in Vietnam.

In 2005, DKT sued the U.S. Agency for International Development, contending its free speech rights were violated by a 2003 law requiring groups to explicitly oppose prostitution and sex trafficking in order to qualify for part of a $15 billion AIDS program. A U.S. District Court ruling last year agreed, saying the funding conditions insist that groups "parrot" the U.S. government's position on prostitution.

But U.S. Circuit Judge A. Raymond Randolph said Congress has authorized the Bush administration to assist non-governmental organizations like DKT "on such terms and conditions as the president may determine."

"The act does not compel DKT to advocate the government's position on prostitution and sex trafficking; it requires only that if DKT wishes to receive funds it must communicate the message the government chooses to fund," Randolph wrote in a 10-page decision reversing the lower court's ruling. "This does not violate the First Amendment."

Calls for comment to DKT's offices in Washington were not immediately returned Tuesday.