WASHINGTON (Reuters) - The U.S. Supreme Court on Wednesday rejected legal reasoning used by President Donald Trump’s high court nominee Neil Gorsuch in his role as an appellate judge, ruling in favor of an autistic student who said he was denied an adequate education.

FILE PHOTO: With his wife Marie Louise (L) looking on, U.S. Supreme Court nominee judge Neil Gorsuch testifies during a third day of his Senate Judiciary Committee confirmation hearing on Capitol Hill in Washington, U.S., March 22, 2017. REUTERS/Jonathan Ernst

The 8-0 ruling, authored by conservative Chief Justice John Roberts, was issued at the same time Gorsuch was facing questions during his Senate confirmation hearing about a 2008 case in which he ruled against an autistic child who sought a public education more tailored to his needs.

The Supreme Court ruled that public schools must offer disabled students a special educational program sufficiently ambitious to ensure they make progress.

Democrats called the Supreme Court ruling a rebuke of the Republican president’s nominee and suggested Gorsuch was not a mainstream judge.

“This is part of a continued, troubling pattern of Judge Gorsuch deciding against everyday Americans - even children who require special assistance at school,” Senate Democratic leader Chuck Schumer said in a statement.

Gorsuch rejected that suggestion, saying he was following court precedent and has ruled in favor of disabled students in other cases.

“If anyone says I like a result where an autistic child happens to lose, it’s a heartbreaking accusation,” Gorsuch testified.

Responding to Democratic Senator Dick Durbin, Gorsuch said the 2008 case and others like it were unanimous three-judge decisions on the Denver-based 10th U.S. Circuit Court of Appeals, on which he sits.

“I was wrong because I was bound by circuit precedent, and I’m sorry,” Gorsuch said.

The justices unanimously ruled in favor of a student referred to as Endrew F and his family, who said his local public school district in Colorado’s Douglas County had failed him. They said schools must offer more than the bare minimum in educational benefits to disabled children, setting aside a lower court ruling that had found the school district had satisfied federal law by doing so.

In 2008, Gorsuch was part of a three-judge panel that ruled against a student in a similar position. Gorsuch, citing court precedent, said the Colorado school district involved in that case was required to provide only a minimum education benefit.

But Roberts wrote that under the federal Individuals with Disabilities Education Act special education must be “reasonably calculated to enable a child to make progress appropriate in light of the child’s circumstances.”

In Endrew’s case, his parents pulled him out of a public school in the county located near Denver, frustrated with his lack of progress. In fifth grade they moved him into a private school specializing in autism, where he advanced quickly.

In 2012, they asked the school district to cover tuition costs. In a 2015 ruling in which Gorsuch did not participate, the court said the district had satisfied its obligations under the law by providing a “merely more than de minimis,” or minimal, educational benefit and that Endrew had made “some academic progress.”

Roberts criticized the minimum-standard approach, saying it meant children would receive instruction that amounted to sitting idly, waiting to drop out. “A student offered an educational program providing ‘merely more than de minimis’ progress from year to year can hardly be said to have been offered an education at all,” Roberts wrote.

Roberts said the current rules are fine for disabled children who are integrated in regular classrooms, but not for those who are not. Educational plans for them, he wrote, must still be “appropriately ambitious in light of his circumstances.”