LOS ANGELES (AP) — Police investigating a notorious gang in a city on California's central coast issued a fake press release that the chief credited with saving two men by deceiving gang members who wanted to kill them, but the ruse was criticized by news organizations who reported it as fact.

Santa Maria Police Chief Ralph Martin defended the rare tactic this week when it came to light, saying he had never done such a thing in his 43-year career, but he wouldn't rule out doing it again.

"It was a moral and ethical decision, and I stand by it," Martin said Friday. "I am keenly aware and sensitive to the community and the media. I also had 21 bodies lying in the city in the last 15 months."

The phony announcement issued in February was discovered in court documents and only reported this week by the Santa Maria Sun, a weekly newspaper in the city 140 miles northwest of Los Angeles.

The daily newspaper and local television stations were unaware the information in the release was false when they reported that two men, Jose Santos Melendez, 22, and Jose Marino Melendez, 23, had been picked up for identity theft and handed over to immigration authorities.

In fact, detectives eavesdropping on the deadly MS-13 gang had raced to the home of the two cousins in nearby Guadalupe and took them into protective custody after learning hit men were on their way there.

Kendra Martinez, news director at KSBY-TV, said she was "deeply troubled" that police misled the public and news organizations.

"While we strongly support the police department's efforts to protect citizens in harm's way, we are concerned this type of deception can erode the basic trust of our residents and viewers," Martinez said.

The sting comes to light as news organizations try to set the record straight as truth and fiction blur amid a proliferation of "fake news" spread by social media.

Jonathan Kotler, a professor at the USC Annenberg journalism school, said there was nothing illegal about what police did, but it could raise questions about the department's future credibility. However, he said the public is unlikely to appreciate the importance of that issue, particularly when the police said it was matter of life and death.

"If the press cries foul here, saying they were led astray by a false release, then you've got the press being angry about being misled," Kotler said. "But on the other hand, the cops would say, 'But look we saved lives.' In that kind of PR battle, who do you think comes off looking better, the press or the police?"

Sending bogus information to the media to advance law enforcement goals is rare but not unheard of. Police in Ottawa, Canada, were criticized for issuing a press release with false information about evidence connected to a 2014 murder case so they could see how the suspects reacted.

Sting operations routinely use ruses to lure deadbeat parents, traffic-fine scofflaws and people wanted for all kinds of outstanding warrants to collect prizes they think they've won.

But those stings, while reported as news, don't make the press a player in the operation and don't dupe law-abiding citizens.

"They used a public system paid for with public dollars to present false information to the public," said Marga Cooley, managing editor of the Santa Maria Times.

Louis Dekmar, vice president of the International Association of Chiefs of Police, said he's only heard tactics like that used three times in his four decades on the force. He would only try such subterfuge in the rarest cases without other reasonable options and only after weighing the long-term consequences.

"Any time you enter into a ruse that involves the media, it creates a real distrust between the police and the folks we rely on," said Dekmar, who is police chief in LaGrange, Georgia. "There's a symbiotic relationship between the media and police. You need facts in order to accurately report to the public. We need the media to report facts accurately to get assistance from the public."

Martin said he did not make the decision lightly as the murder rate soared in the city of about 110,000 that typically has three to four homicides a year.

Using wiretaps and surveillance, police learned the Melendez men, members of a rival gang who lost another cousin to violence seven months earlier, were about to be killed, he said.

Police concluded they would expose their long-running Operation Matador if they made arrests, so they took the cousins into protective custody before the MS-13 hit men arrived. Figuring the would-be killers might harm family members if they thought the men were in hiding, police fabricated the press release about their arrests.

After MS-13 gang members returned the next day looking for the two, police overheard a phone conversation with them discussing the news report that the men had been arrested for identity theft.

Martin said it bought investigators another three weeks to gather evidence that led to the arrest of 17 gang members on charges of 10 murders and plots to kill eight others, including the two cousins, who remain under protection.

Martin said he's taken some flak from news media, but he has also received about two dozen supportive calls. "I think if they were in my shoes they would have done the same thing," he said.