Facebook executives told Attorney General William Barr that the company doesn't plan to weaken encryption across its messaging products despite his requests that it do so on the premise that it could reduce public safety.

The letter, dated Monday, was in response to Barr's October letter that urged Facebook to postpone its plans for end-to-end encryption across its three messaging services, WhatsApp, Instagram and Messenger. Barr, U.K. Home Secretary Priti Patel, then-acting U.S. Secretary of Homeland Security Kevin McAleenan, and Australian Minister for Home Affairs Peter Dutton also asked Facebook to create a way for law enforcement to access illegal content.

WhatsApp head Will Cathcart and Messenger head Stan Chudnovsky argue in the letter that the "backdoor" access Barr and other government officials are requesting would be a "gift to criminals, hackers and repressive regimes" and could leave users open to "real-life harm."

"It is simply impossible to create such a backdoor for one purpose and not expect others to try and open it," Facebook's letter says. "People's private messages would be less secure and the real winners would be anyone seeking to take advantage of that weakened security. That is not something we are prepared to do."

Earlier this year, Facebook unveiled plans to merge the technology behind its three messaging platforms. The idea raised antitrust concerns since Facebook already faces a wave of regulatory scrutiny.

Tech companies and government officials have been locked in a debate over encryption. Officials argue encryption will make it harder for them to spot illegal activity, since the messages are secured, whereas tech companies and security experts say encryption is a necessary tool for protecting users' private conversations.

Facebook's response came a day before Jay Sullivan, Messenger's product management director for privacy and integrity, appeared Tuesday in front of the Senate Judiciary Committee. The hearing, centered around encryption and lawful access, also includes participation from Erik Neuenschwander, Apple's manager of user privacy, as well as New York District Attorney Cyrus Vance Jr. and other security experts. The hearing is expected to touch on the arguments around backdoor accesss, among other topics.

--CNBC's Lauren Feiner contributed to this report.