SAN FRANCISCO (Reuters) - U.S. investigators failed in a recent courtroom effort to force Facebook to wiretap voice calls over its Messenger app in a closely watched test case, according to two people briefed on the sealed ruling.

Attendees walk past a Facebook Messenger logo during Facebook Inc's annual F8 developers conference in San Jose, California, U.S. May 1, 2018. REUTERS/Stephen Lam

Members of a joint federal and state task force probing the international criminal gang MS-13 had tried in August to hold Facebook in contempt of court for failing to carry out a wiretap order, Reuters reported last month.

Arguments were heard in a sealed proceeding in a U.S. District Court in Fresno, California weeks before 16 suspected gang members were indicted there, but the judge ruled in Facebook’s favor, the sources said.

The details of his reasoning were not available.

The government’s request had alarmed technology executives and privacy advocates. Officials in the United States and other Western countries are stepping up attempts to ban or limit strong encryption and expand their wiretapping capabilities.

An affidavit by an FBI agent filed publicly in the Fresno criminal proceedings said that at the time of the arrests, law enforcement could not monitor any Messenger calls.

Telecommunications companies are required to give police access to calls under federal law, but many apps that rely solely on internet infrastructure are exempt. Facebook contended Messenger was covered by that exemption.

The public court filings showed the government was intercepting all ordinary phone calls and Messenger texts between the accused gang members.

The FBI affidavit cited three Messenger calls that investigators were unable to hear. The participants in those calls are now in jail pending trial.

Neither prosecutors nor Facebook would answer questions about the Fresno U.S. Attorney’s office attempt to hold Facebook in contempt or about the underlying wiretap request, including why the matter was dismissed.

The judge heard oral arguments on the contempt motion on Aug. 14. Facebook and a Department of Justice spokeswoman declined to comment.

FBI agent Ryan Yetter, in the affidavit dated Aug. 30, wrote “currently, there is no practical method available by which law enforcement can monitor” calls on Messenger. The affidavit was filed in support of a criminal complaint against members of MS-13, which is active in the United States and Central America.

MS-13 also known as Mara Salvatrucha is an international criminal gang that originated in Los Angeles in the 1980s. The gang’s activities later spread to many parts of the United States, Canada, Mexico, and Central America.

U.S. President Donald Trump frequently uses the gang to symbolize what he faults as lax U.S. immigration policy.

Most of the 16 gang suspects were arrested by Aug. 30, and the indictment was issued on Sep. 13. Including charges by California state, more than two dozen people were accused of murder and other crimes.

More information about the government’s court tussle with Facebook may come to light through lawyers for the 16 defendants. Mark Broughton, an attorney for one of the defendants, Denis Barrera-Palma, said he would soon start receiving the government’s evidence.

If the prosecutors’ application to wiretap Facebook Messenger voice calls is not included, Broughton said he would ask for it.

“I would be interested in seeing, or trying to get an order unsealing that information to properly represent my client,” Broughton said.

Barrera-Palma faces federal counts of assault with a deadly weapon and drug conspiracy, and California charges of murder conspiracy. He has pleaded not guilty to the federal counts and has not yet entered a plea in state court.

The still-private filings in the skirmish with Facebook might explain why federal officials picked Messenger’s voice calls as a target.

One matter judges weigh in wiretap matters is how much of a burden it would be for the company to help. In contrast to Facebook’s WhatsApp messaging app and a separate part of Messenger called secret conversations, Facebook plays a small technical role facilitating Messenger voice calls, making interception possible with some effort.

Nevertheless, Facebook maintained it could not be ordered to alter its software or hack its user in order to help the FBI. Apple made a similar argument in refusing to break into a terrorist’s iPhone in 2016.