The federal judge in the Lower Merion schools redistricting case said Wednesday that he would rule by the end of June and wished opposing sides good luck with an appeal he said was inevitable.

"This is an important case, but a very difficult case," U.S. District Judge Michael M. Baylson said. "You've struggled over this case, and I'll do my very best to do the right thing."

The judge said at the end of hour-long oral arguments that the sides were "very close." He wished the parties "good luck with the Third Circuit Court," meaning he expected his ruling to be appealed.

During the hearing, attorneys for nine South Ardmore students and the Lower Merion School District wrangled over which legal framework, including a 2007 U.S. Supreme Court case, should guide Baylson's deliberations.

The pupils, who live in a diverse community in South Ardmore, went to court in May 2009 to win the right to walk to their neighborhood school, Lower Merion High. They must go five miles to Harriton High School under a redistricting plan implemented in September.

The lawyer representing the nine students, David G.C. Arnold, argued during a trial in April that they had been targeted based on race as school administrators prepared the redistricting plan. Because of that, he claimed, the pupils were denied equal protection under federal law.

Judith E. Harris, counsel for the district, countered that Arnold failed to establish intentional discrimination, and that geography and a host of other factors drove the redistricting process instead.

On Wednesday, Arnold argued that any time a public body uses race as a basis for an action, the act defies the Constitution and triggers a strict review to see whether it is legal.

Harris said no such review was needed. She said race could be considered for purposes of creating diversity in the classroom, especially when two good schools are involved.

"This is not a situation where some students are going to get an education and some are not," Harris argued.

In a May 13 memorandum, Baylson sided with the plaintiffs that race was, indeed, a factor.

"Like a leitmotif in a Wagner opera, a recurring theme with variations, the process of redistricting repeatedly embraced the goal of achieving racial parity between the two high schools," the judge wrote.

But Baylson stopped short of ruling on what that would mean for the plaintiffs. They have sought only legal fees and the right to go to Lower Merion High.

Baylson then asked the two sides to submit briefs stating whether Parents Involved in Community Schools v. Seattle School District No. 1 should serve as legal framework for the local matter.

The Seattle case went to the Supreme Court, and the justices' 5-4 ruling, with piecemeal opinions in favor of the parents, has raised questions of interpretation.