NEW YORK (AP) _ More than 150 Haitian refugees held at a U.S. Naval base in Cuba after testing positive for the AIDS virus were ordered released Tuesday by a judge who criticized the federal government's handling of the case.

The 158 refugees, including many who spent nearly 20 months at Guantanamo Bay, were victims of ''outrageous, callous and reprehensible'' behavior by the Bush and Clinton administrations, U.S. District Judge Sterling Johnson said.

''The Haitians plight is a tragedy of immense proportion, and their continued detainment is totally unacceptable to this court,'' Johnson wrote in his decision.

Johnson's ruling called for the immediate release of the refugees.

The refugees fled their homeland and its political problems by boat, but they were intercepted at sea. They have been held more than 18 months at the base because of a U.S. immigration policy banning the entry of HIV-positive immigrants.

Virtually all of the refugees have tested positive for the AIDS virus. A lawsuit was filed on their behalf in March 1992. Johnson's ruling followed a two-week trial in March 1993.

''We think the decision sends a wake-up call to the Clinton administration that it cannot continue to blindly follow the illegal policies of the Bush administration,'' said Lucas Guttentag of the American Civil Liberties Union Immigrants Rights Project.

Michael Ratner of the Center for Constitutional Reform said the camp - with its barbed wire and shanty homes - could be closed within weeks if the federal government doesn't appeal the decision.

Ratner delivered word of the decision by phone to refugee leader Michel Vilsaint, who told the attorney people at Guantanamo were dancing and cheering when they received the news.

Thousands of other Haitians have been allowed to enter the United States on political asylum requests since the ouster two years ago of Jean-Bertrand Aristide as Haiti's first democratically elected president.

Johnson had previously ordered the government to release more than 50 Haitians with AIDS to the United States for treatment.