A Superior Court judge in Los Angeles on Tuesday struck down state laws in California governing teacher tenure, ruling against teachers unions in a sweeping decision that's expected to upend how teachers are hired and fired in the state -- and possibly far beyond it.

The case, Vergara v. California, will likely be appealed to the Supreme Court and could set off similar legal challenges in other states. Brought on behalf of nine public-school students in the state, the case challenged a set of laws, including one that gives teachers in California tenure as early as 18 months into their careers. Another requires layoffs on a last-in/first-out basis that excludes consideration of teacher quality.

Students Matter, a Silicon Valley-based group that brought the suit, argued that these policies make it hard to fire "grossly ineffective" teachers and to retain high-quality junior ones, and that low-income minority students disproportionately suffer as bad teachers are shuttled into their classrooms. Judge Rolf M. Treu forcefully agreed in his opinion, finding that five California statues violate the constitutional protection children have in the state to equal educational opportunity.

Wrote Treu: "Evidence has been elicited in this trial of the specific effect of grossly ineffective teachers on students. The evidence is compelling. Indeed, it shocks the conscience."

Much of the evidence he was talking about came from economist Raj Chetty, who has calculated that the worst performing teachers can cost a classroom of children over one year of exposure $1.4 million in lifetime earnings. Chetty, who presented expert testimony during the two-month trial, drew on findings from a study published in 2011 with John N. Friedman and Jonah E. Rockoff.

They looked at data on 2.5 million students, grades three through eight, in a "large urban school district" between 1989 and 2009, and compared their math and English test scores to later tax records as adults.

Chetty summarized the findings in the case with the following graphs taken from his testimony. Students who had higher "value-added" teachers for even a year (these are teachers measured for their impact on student test scores) were more likely to go to college:

They were less likely to have teen pregnancies:

And they had higher adult earnings:

Lay off teachers by tenure ("last in, first out") rather than effectiveness in the Los Angeles Unified School District, Chetty argued, and these are the kinds of real-life impacts that result from the below distribution:

That conclusion is disputed by teacher's groups who argue that removing their job protections won't help students learn. The fiercely political debate over this question in California and elsewhere won't by resolved by one study, or even several others cited in the case. But by his own words, this data clearly had an impact on Treu's ruling.