In a blow to activists against illegal immigration, a Los Angeles Superior Court judge upheld the LAPD’s Special Order 40, which limits when officers can ask about immigration status.

In his ruling, Judge Rolf M. Treu found the conservative Judicial Watch – which brought the suit on behalf of a Los Angeles taxpayer – failed to show the policy conflicted with federal law, which prohibits restrictions on state and local police from communicating with immigration officials.

“This is good news,” LAPD Chief William Bratton said. “It is an essential tool and continues to be an essential tool of the Los Angeles Police Department.”

Paul Orfandedes, an attorney for Judicial Watch, had a different take.

“This is effectively the LAPD’s `don’t ask, don’t tell’ policy,” said Orfandedes, who filed suit on behalf of Harold Sturgeon, who claimed his tax money was wasted on a policy that violates federal law. “I don’t think this should be read as a green light for Special Order 40. There will continue to be challenges to it.”

Los Angeles Mayor Antonio Villaraigosa said he agreed with the court ruling.

“The court agreed today with Chief Bratton and just about every law enforcement official in the state that turning local police into federal immigration agents would lead to fewer arrests, prosecutions and convictions,” he said.

City Councilman Dennis Zine, who has called for toughening police actions against illegal immigrants, said he was not surprised or opposed to the ruling.

“My problem is not with Special Order 40,” he said. “We shouldn’t be going after people who have not broken any other laws. My problem is with the violent gang members who are in this country illegally. We should use the full force of the law to go after them.”

The controversial, three-decade-old policy became a hot topic earlier this year after an illegal immigrant was charged with killing 17-year-old Jamiel Shaw Jr. near his Arlington Heights home.