A California judge ruled Tuesday that teacher tenure laws deprived students of their right to an education under the State Constitution and violated their civil rights. The decision hands teachers’ unions a major defeat in a landmark case, one that could radically alter how California teachers are hired and fired and prompt challenges to tenure laws in other states.

The decision, which was enthusiastically endorsed by Education Secretary Arne Duncan, brings a close to the first chapter of the case, Vergara v. California, in which a group of student plaintiffs backed by a Silicon Valley millionaire argued that state tenure laws had deprived them of a decent education by leaving bad teachers in place.

David Welch, a Silicon Valley technology magnate, spent several million dollars to create the organization that brought the Vergara case to court — Students Matter — and paid for a team of high-profile lawyers, including Theodore J. Boutrous Jr., who helped win a Supreme Court decision striking down California’s same-sex marriage ban. While the next move is still unclear, the group is considering filing lawsuits in New York, Connecticut, Maryland, Oregon, New Mexico, Idaho and Kansas as well as other states with powerful unions where legislatures have defeated attempts to change teacher tenure laws.

In his sharply worded 16-page ruling, Judge Treu compared the Vergara case to the historic desegregation battle of Brown v. Board of Education, saying that the earlier case addressed “a student’s fundamental right to equality of the educational experience,” and that this case involved applying that principle to the “quality of the educational experience.”

He agreed with the plaintiffs’ argument that California’s current laws make it impossible to remove the system’s numerous low-performing and incompetent teachers, because the tenure system assures them a job essentially for life; that seniority rules requiring the newest teachers to be laid off first were harmful; and that granting tenure to teachers after only two years on the job was farcical, offering far too little time for a fair assessment of the teacher’s skills.

Further, Judge Treu said, the least effective teachers are disproportionately assigned to schools filled with low-income and minority students. The situation violates those students’ constitutional right to an equal education, he determined. It is believed to be the first legal opinion to assert that the quality of an education is as important as mere access to schools or sufficient funding.

He also had harsh words for the layoff system that protects veteran teachers without regard to any evaluation. “The logic of this position is unfathomable and therefore constitutionally unsupportable,” he wrote.