The Supreme Court appeared headed on Monday toward a ruling that will sharply limit, if not eliminate, the use of race as a factor in assigning students to public schools to achieve diversity.

During two hours of oral argument, Justice Anthony Kennedy, whose vote may determine the outcome of the case, seemed deeply skeptical of the constitutionality of using race as a factor, especially in a school district that has already been declared “unitary” and ended efforts to desegregate.