NEW YORK (AP) _ A federal appeals court on Monday upheld the jailing of a Hasidic rabbi and his wife for refusing on religious grounds to testify against other Jews.

Nochum and Esther Sternberg, of Brooklyn, have been jailed since June 18 when a judge found them in contempt for refusing to answer questions before a federal grand jury investigating a tax-fraud scheme.

A three-judge panel of the 2nd U.S. Circuit Court of Appeals upheld the contempt finding and refused to free the couple.

''The law of this circuit is clear that the refusal to testify before a grand jury for religious reasons does not outweigh the compelling state interest in hearing all evidence bearing on the subject of a grand jury investigation,'' the court said.

The panel also noted that prosecutors granted the Sternbergs immunity in exchange for testimony.

On appeal, their attorney, Nathan Lewin, claimed U.S. District Judge Milton Pollack should have held a hearing on the religious argument before he ordered the couple to testify or go to jail.

Lewin said Jewish law has a strong religious prohibition against informers who testify against other Jews in a secular court.

The Sternbergs, who are in their 50s, were convicted several years ago and served prison terms for involvement in a tax scam.

They had been called to testify against Joseph and Leonard Wasser, who were charged last week in a $20 million garment-center phony tax-deduction scheme.

Prosecutors said they wanted the Sternbergs to add to the allegations against the Wassers.