A federal judge had several sharp and skeptical questions Friday for D.C. education activists who have sued to halt the planned closure of 15 city schools.

Opponents argue that the closures would disproportionately affect poor and minority children and therefore violate a number of civil rights laws. In a packed U.S. District courtroom Friday, they pleaded for a preliminary injunction to block the closures, citing “irreparable harm” to children if the plan put forth by Chancellor Kaya Henderson is allowed to move forward.

But Judge James E. Boasberg raised concerns about that argument. Minutes after the hearing began, he referred to a sheaf of statistics demonstrating that most of the children affected by closures are slated to attend schools with higher test scores and more racial diversity than the schools they’re leaving behind.

“The whole purpose of going to school, for these kids, is to receive a good education, correct?” Boasberg said. “It seems to me that the schools they’re transferring into are a whole lot better.”

Attorney Jamie B. Raskin, arguing on behalf of five plaintiffs with the community group Empower D.C., said Boasberg’s question sidestepped the central point of the lawsuit.

Fifteen schools in the District will close within the next two school years.

“The point is that having a neighborhood school is a precious public resource and a precious public benefit that we think should not be distributed along the lines of race and class,” said Raskin, a constitutional law professor and Democratic Maryland state senator.

Thirteen schools are slated to close in June and two more in 2014.

The move will displace more than 2,700 children, almost all of whom are African American or Hispanic.

District attorneys on Friday denied that the closures are discriminatory, describing them as an effort to improve education across the city. Children have no constitutional right to a neighborhood school, they said, and having students move to a new school does not deprive them of services.

Henderson, who in January announced her intent to close the schools, has long said that the school system must close buildings left half-empty after four decades of declining enrollment. Under-enrolled schools are expensive and inefficient to operate, according to the chancellor, who was in the courtroom Friday but did not speak during the proceedings and declined to comment afterward.

Boasberg, whose brother is the superintendent of Denver Public Schools, asked the plaintiffs repeatedly to explain when a school system leader could ever legally close a school with a higher-than-average percentage of minority children.

Raskin said the problem is not the closing of individual schools, but a historical pattern of closing schools in poor and minority neighborhoods.

Schools in affluent areas west of Rock Creek Park have been under-enrolled at times over the past several decades, he said, but remained open.

Sitting in the courtroom were many school-closure opponents who had rallied outside the courthouse before the hearing. When Boasberg asked whether the plaintiffs’ attorneys believed that Henderson — who is African American — intended to discriminate against black and Hispanic children, some in the audience responded “Yes!”

Boasberg continued, asking whether the attorneys believed that African American leaders in other cities where schools are closing, such as Philadelphia and Chicago, also intend to discriminate.

“Yes!” the audience said again before the judge quieted the courtroom.

Raskin then stepped in, saying that plaintiffs are not accusing Henderson of racial hatred but are highlighting a pattern of discrimination that grows out of the District’s history as a segregated city. That history is “now fundamentally impairing people’s ability to have an equal right to a neighborhood school,” he said.

The plaintiffs also said that the city failed to give proper notice of the closure plan to Advisory Neighborhood Commission members. Boasberg said he had concerns about whether plaintiffs had legal standing to sue on those grounds.

The judge said he would issue a decision on the preliminary injunction next week.