A Los Angeles County judge granted a temporary restraining order Thursday to block some police use-of-force and misconduct records from being released by the county, marking the latest step in an effort by California police unions to bar access to records following the passage of a landmark transparency law.

The move comes two days after The Times and Southern California Public Radio filed a lawsuit against Los Angeles County alleging the Sheriff’s Department violated the state public records act in failing to timely disclose records about two deputy sheriffs.

The order issued Thursday by Judge Mitchell L. Beckloff after a request from the Assn. for Los Angeles Deputy Sheriffs means the records sought by the media organizations are temporarily blocked from release.

Law enforcement unions in Ventura, San Bernardino and Riverside counties as well as the city of Los Angeles have also persuaded courts to temporarily restrict access to records of incidents that took place before Jan. 1, when the transparency law went into effect.

A similar move by the Walnut Creek Police Officers’ Assn. in Contra Costa County is pending.

The police unions argue that Senate Bill 1421 — which opens up records of shootings by officers, severe uses of force and confirmed cases of sexual assault and lying by officers — would violate officer privacy protections if applied to cases predating the beginning of the year.

Before the law went into effect, California had the nation’s strictest protections on internal police files, barring even prosecutors from directly accessing them.

Jacob Kalinski, an attorney representing ALADS and other police unions seeking temporary restraining orders, said it’s unfair to change the rules on officers who made career decisions based on their files being confidential.

Kalinski said officers wrongly accused of misconduct might have been more willing to appeal their discipline if they had known that their records would one day become public.

“But now if the activity is brought to light, that could be detrimental to a career,” Kalinski said.

The police associations say there is nothing in the law’s language specifying that it applies retroactively.

But an attorney for The Times and SCPR, which seek to intervene in the ALADS case, argued the law allows for the release of certain records if they are currently in an agency’s possession, regardless of the date on the documents.

“It’s disappointing that these restraining orders are being granted because they interfere with the public’s right to know and the clear intention of the Legislature,” said the attorney, Kelly Aviles, adding that she understands the court may need more time to evaluate the matter.

In issuing his order, Beckloff said if the statute is not intended to cover records of events prior to Jan. 1, there would be “great harm” to deputies if their documents were to be released. He did not elaborate. A hearing to further examine the issue is set for Feb. 15.

Lana Choi, an attorney for Los Angeles County, told the judge the county was prepared to provide records under the new law and sought the court’s guidance on the matter. She said the county did not oppose ALADS’ request for a temporary restraining order.

Several agencies including the San Luis Obispo County Sheriff’s Office and the San Bernardino, Santa Barbara, Burlingame and Cathedral City police departments have already disclosed records under the new transparency law.

The separate lawsuit filed this week by The Times and SCPR, which operates KPCC 89.3 in Pasadena, says the Los Angeles County Sheriff’s Department has violated the state public records act by not disclosing records about two deputies. The media organizations argue the documents are subject to release under the new transparency law.

The Times seeks records pertaining to Deputy Caren Carl Mandoyan, who was fired in 2016 in connection with allegations of domestic abuse and stalking and was recently reinstated by Sheriff Alex Villanueva. Mandoyan worked as a campaign aide to Villanueva.

SCPR has requested records about Deputy Gonzalo Inzunza, who shot at four people within a seven-month period and was the focus of the podcast “Repeat,” which examined the Sheriff’s Department’s handling of shooting investigations.

County spokeswoman Lennie LaGuire said the county doesn’t comment on pending cases. Nicole Nishida, a spokeswoman for the Sheriff’s Department, said the agency has not received the lawsuit and also declines to comment on pending litigation.

Times staff writer Ben Poston contributed to this report.