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.