WASHINGTON - The Supreme Court agreed yesterday to decide whether a Christian student group's right to religious liberty and the freedom of association can trump a university's ban on discrimination against gays and lesbians.

The case, Christian Legal Society v. Martinez, could set new rules for campus groups that receive funding through fees paid by the students.

The justices agreed to hear an appeal from a San Francisco chapter of the Christian Legal Society that lost its recognition as a student group at the University of California Hastings College of Law because it refused to abide by the school's antidiscrimination policy.

The school says its officially recognized student groups must be open to all. A university policy forbids discrimination based on "race, color, religion, national origin, ancestry, disability, age, sex or sexual orientation" in all its programs

Five years ago, the CLS chapter's new leaders declared they would not agree to accept students who are gay or lesbian or who do not adhere to traditional Christian beliefs. They cited their group's national policy, which says, "In view of the clear dictates of Scripture, unrepentant participation in and advocacy of a sexually immoral lifestyle is inconsistent with an affirmation of the Statement of Faith" set by the organization.

Citing this refusal, the law school said the chapter would lose its status as an official student group. This meant the school would not pay travel costs for the group's leaders to attend national meetings. The group also lost its right to use reserved rooms for meetings and to use the school's Web site to promote itself to other students.

The two sides differ on who is the victim of discrimination.

Kim Colby, a lawyer for the CLS Center for Law and Religious Freedom, said a Christian group should not be forced to "abandon its identity" to win campus recognition.

Ethan Schulman, a San Francisco lawyer who represents the law school, said the Christian students were free to meet informally on campus.