San Francisco police obtained a warrant to search a freelance journalist’s phone records and were authorized to “conduct remote monitoring” on the phone more than two months before a controversial raid on his home and office, according to documents released Friday.

Officers executed the warrant on Bryan Carmody’s phone records on March 1 — the first of seven search warrants obtained in the investigation into who leaked him a report on the Feb. 22 death of Public Defender Jeff Adachi.

The revelation that police had broad authority to covertly monitor Carmody adds a new twist to the unfolding case that was thrust into the national spotlight when police used a sledgehammer to raid his home and office on May 10. Officers seized Carmody’s computers, phones and other electronic devices after learning he had sold the report to three television news stations.

It’s still not clear how police justified the searches to at least three judges, how police knew Carmody obtained the report and whether officers listened in on the private calls of a journalist after executing the warrant.

“The SFPD appears to have used the illegal warrant to spy on Bryan’s movements, phone calls and communications,” Carmody’s defense attorney, Ben Berkowitz, said in a statement Friday. “This is an alarming and deeply disturbing attack on the free press in an attempt to unmask Mr. Carmody’s confidential source.”

California’s shield law protects journalists from being compelled to reveal confidential sources and other unpublished material like notes and photographs. The law specifically bars police searches seeking such materials and applies to freelancers.

Carmody on Friday posted part of the latest search warrant on social media. Police sent him the document this week by certified mail. Under the law, police can delay revealing that they served a warrant on a person’s phone records.

San Francisco police did not immediately respond to questions about the warrant. But after defending the search for two weeks, Police Chief Bill Scott apologized and conceded the raid was wrong. He specifically mentioned the warrant for Carmody’s phone was problematic in a May 24 interview with The Chronicle.

Tony Montoya, the president of the union representing the department’s rank and file, seized on the chief’s reversal and called for his resignation in a scathing statement that said Scott was personally involved in every step of the investigation.

Tensions between the union and chief have smoldered since Scott was appointed to oversee reforms at the department in 2017, after the more union-friendly Chief Greg Suhr resigned following several controversial police shootings.

The initial warrant on Carmody’s phone, written by Sgt. Joseph Obidi in the department’s Internal Affairs Bureau, allowed police to obtain subscriber information, call detail records, SMS usage and cell tower data for Feb. 22 and 23.

Local television news stations began reporting on the contents of the leaked police report — including that Adachi collapsed in an apartment on Telegraph Hill with a woman who was not his wife — on Feb. 23, the day after he died.

Some city officials and attorneys in the public defender’s office believed a member of the department leaked the report in an attempt to smear Adachi, who fought against police misconduct. At a fiery April meeting at the city Board of Supervisors, the public defender’s office publicly revealed for the first time that a freelance “stringer” had offered the report for sale to television stations.

Details of the warrant made public Friday, though, show that police had already identified Carmody weeks before that meeting, raising questions about who told police he had the report.

The Chronicle also obtained a copy of the report but did not pay for it or get it from Carmody.

The warrant authorized police “to conduct remote monitoring on the subject telephone number device, day or night, including those signals produced in public, or location not open to public or visual surveillance.”

Police officials did not respond to questions about whether they monitored Carmody’s phone after the warrant was executed.

The warrant also revealed that a third judge had signed off on the search of a journalist. Judge Rochelle East signed the warrant for the phone after Obidi wrote that Carmody was “being investigated as a co-conspirator in the theft of the San Francisco Police report involved the death investigation of Jeff Adachi.”

The warrant, though, does not mention that Carmody was working as a journalist, and it’s unclear what is in the accompanying probable cause statement that remains under seal.

The two warrants for Carmody’s home and office in May were also written by Obidi. The probable cause statements for those warrants also remain sealed and the judges who signed them, Victor Hwang and Gail Dekreon, have not commented.

San Francisco police executed at least seven warrants — including the search on Carmody’s phone and searches of police officers — in their investigation, The Chronicle reported this week. At the time, Carmody and his attorneys said they were unaware that his phone was searched.

Carmody’s civil attorney, Thomas Burke, filed a motion to quash the search warrants, while press freedom groups like the First Amendment Coalition have filed motions to unseal the warrants. The Police Department filed its briefs in opposition Friday.

In the motion, an attorney for the Police Department cited case precedent to keep the warrants sealed but made no factual arguments. The department said it has returned all of Carmody’s property, but the items did not include the leaked police report.

Evan Sernoffsky is a San Francisco Chronicle staff writer. Email: esernoffsky@sfchronicle.com Twitter: @EvanSernoffsky