While fake news stories have been widely criticized after the elections, one police chief credits a false press release with saving the lives of two men.

Police Chief Ralph Martin of Santa Maria, California, issued a false press release claiming two men had been arrested so authorities could shielding them from gang members while keeping their sting operation under wraps.

The ruse was criticized by news organizations that reported it as fact, but Martin said it bought investigators 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.

Police Chief Ralph Martin (pictured) issued a false press release claiming two men had been arrested so authorities could shielding them from gang members

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 his cousin Jose Marino Melendez, 23, had been arrested for identity theft and handed over to immigration authorities.

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

Police worried the hit men might harm family members instead if they thought the two men were in hiding. But they also did not want to expose their long-running sting operation by making arrests.

So they took the two men into protective custody and fabricated the news release.

After MS-13 gang members returned the next day looking for the two, police overheard a phone conversation among the MS-13 gang members discussing the news that their targets had been arrested.

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.

He added: 'It was a moral and ethical decision, and I stand by it. 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.'

Police worried the hit men might harm family members if they thought the two men were in hiding. They also did not want to expose their long-running sting operation by making arrests

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.

But he added that the public was unlikely to appreciate the importance of that issue, particularly when the police said it was matter of life and death.

So they took the two men into protective custody and fabricated the news release, a move that was criticized for eroding trust

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.