The U.S. and the U.K. have signed a first-of-its-kind agreement that will allow law enforcement agencies in the countries to access data from tech companies more quickly in criminal investigations.

In a press release late Thursday, the Justice Department said the historic agreement will “dramatically speed up investigations by removing legal barriers to timely and effective collection of electronic evidence.” The pact will allow U.K. authorities to go directly to tech companies like Facebook, Google or Twitter for evidence in cases related to terrorism, child sexual abuse and other serious crimes. U.S. officials will also be able to receive access to British communication service providers.

Currently, authorities must go through government agencies to access such evidence from companies, which the officials said can take “years.” Under the new agreement, the process will be reduced to “a matter of weeks or even days,” according to the U.K. Home Office.

“Only by addressing the problem of timely access to electronic evidence of crime committed in one country that is stored in another, can we hope to keep pace with twenty-first century threats,” Attorney General William Barr said in a statement.

The agreement will go into force once approved by lawmakers in the U.S. and U.K. It was reached as part of the CLOUD (Clarifying Lawful Overseas Use of Data) Act, a law enacted in 2018 that allows the U.S. to enter bilateral agreements with other countries to access electronic data stored overseas.

The new agreement will not, however, prevent tech companies from encrypting data on their platforms. End-to-end encryption, which already exists in some apps like WhatsApp and Signal, means that only users sending and receiving messages can see them.

In an open letter published alongside the agreement Thursday, Barr and officials from the U.K. and Australia urged Facebook CEO Mark Zuckerberg to halt the company’s encryption efforts across its messaging services. The letter said end-to-end encryption reduces law enforcement’s ability to protect the public.

Encryption was a key tenet of Mark Zuckerberg’s vision to make Facebook a more “privacy-focused” company, which he unveiled in March. In a statement Thursday, Facebook said, “We strongly oppose government attempts to build backdoors because they would undermine the privacy and security of people everywhere.”

Twitter declined to comment on the new agreement, while Google was not immediately available for comment.