(Reuters) - President Donald Trump lashed out at Apple Inc AAPL.O on Tuesday, castigating the iPhone maker for what he said was its refusal to unlock phones used by criminals while benefiting from government help on trade.

Trump’s tweet came amid the investigation into the fatal shooting of three Americans by a Saudi Air Force officer at the U.S. Naval Station in Pensacola, Florida, last month, which Attorney General William Barr called “an act of terrorism” on Monday.

The episode marks the latest flare-up in a privacy debate between technology companies such as Apple and Facebook Inc FB.O and authorities.

The tech companies argue that strong encryption protects the privacy and security of their users, while law enforcement officials say criminals have used the technology to evade justice and called on tech firms to provide a way to crack it, using high-profile cases such as Pensacola and the 2015 mass shooting by Islamic militants in San Bernardino, California, as examples.

Trump on Tuesday had harsh words for Apple.

“We are helping Apple all of the time on TRADE and so many other issues, and yet they refuse to unlock phones used by killers, drug dealers and other violent criminal elements,” the U.S. president said on Twitter. “They will have to step up to the plate and help our great Country, NOW!” he said.

Apple has said it cannot access data that is encrypted with a passcode and stored on an iPhone and that it would have to build a specific tool for doing so, known in the tech industry as a “backdoor.” The company can and does, however, hand over data stored on its cloud storage servers to law enforcement officials, which often includes backups of iPhones, including iMessages.

Slideshow ( 2 images )

Apple did not respond to a request for comment on Trump’s tweet. On Monday, the company said it rejected “the characterization that Apple has not provided substantive assistance.”

Earlier on Monday Barr called on Apple to help the Federal Bureau of Investigation unlock two iPhones involved in the Pensacola case.

Apple said it had responded to seven separate legal requests from federal investigators in December, starting the day of the shooting.

The company said it turned over “many gigabytes” of data to investigators, including iCloud backups, account information and transactional data for multiple accounts. Apple said the FBI did not request help unlocking phones until Jan. 6, with a request for a second iPhone sent on Jan. 8.

“A federal judge has authorized the Department of Justice to access the contents of the dead terrorist’s phones. Apple designed these phones and implemented their encryption. It’s a simple, ‘front-door’ request: Will Apple help us get into the shooter’s phones or not?” Kerri Kupec, a Department of Justice spokeswoman, said in a statement on Tuesday.

In a statement, the American Civil Liberties Union called Trump’s demand “dangerous and unconstitutional” and said it would weaken the security of millions of iPhones.

“There is simply no way for Apple, or any other company, to provide the FBI access to encrypted communications without also providing it to authoritarian foreign governments and weakening our defenses against criminals and hackers,” the ACLU said.

After the shooting in San Bernardino, California, in 2015, federal investigators eventually turned to third-party cybersecurity firms for help to unlock the shooter’s device.

The Wall Street Journal on Monday reported that the devices used by the Pensacola shooter were older iPhone 5 and iPhone 7 models and cited cybersecurity experts as saying commercial firms could likely crack them.