A judge has ruled that California's tenure protections for public school teachers are unconstitutional.

Los Angeles County Superior Court Judge Rolf Treu on Tuesday ruled in favor of nine students who sued the state saying tenure and seniority policies have made it virtually impossible to fire bad teachers.

"The court said this is a lose-lose situation," said Plaintiff Counsel Ted Butros, who represented a group of nine students. 

They were backed by a Silicon Valley investor and had the support of LA Unified head John Deasy. He says the firing process can take years.

"That money should be spent on procuring new supplies, instituting new programs and improving teacher salaries," Deasy said. 

Lawyers for the teachers say the changes would allow the firing of teachers on a whim.

They argued that tenure laws preserve academic freedom and help attract talented teachers to a profession that doesn't pay well.

The decision could have wide-ranging impact on the way California hires and fires teachers and could spur changes in other states with strong tenure laws.

Dozens of states have moved in recent years to weaken or throw out their seniority policies.

Unions have vowed to appeal, arguing that tenure is key in attracting the best candidates to jobs that really don't pay very well. There is a stay on any changes to the law.

-- The Associated Press contributed to this report.