The new bill is targeted at foreigners’ communications, but it also empowers the government to surveil French citizens who communicate with foreigners—even if that communication consists solely of unsolicited messages.

The French Constitutional Court partially struck down a prior surveillance law as unconstitutional in July, prompting lawmakers to try again, but critics say that the new bill contains largely the same problems.

“Passage of this bill confirms a worrying trend in the French digital policy towards policing the web and its users,” Estelle Massé, a policy analyst at the global digital-rights group Access, said in a statement. “There is a stark contradiction between the French government’s outrage over being subject to surveillance and passing legislation that grants the [General Directorate for External Security] the same kind of indiscriminate spying powers as the NSA.”

As Access noted, the government of French President François Hollande reacted strongly in June to news that the National Security Agency had intercepted the conversations of top French officials, including Hollande and his two predecessors. Hollande’s office called the U.S. surveillance “unacceptable.” But in a sign of how important the U.S.–French counterterrorism partnership remains, France subsequently moderated its rhetoric.

Leading French, American, and European civil-liberties groups condemned the new bill in a joint statement issued on Wednesday.

“The bill seeks to legitimize the civil- and human-rights abuses revealed by Edward Snowden about the practice of intelligence agencies such as the ones in the US and the UK,” the groups said. “As a crucial part of the global Internet traffic goes through French submarine cables, this law would put France in the list of countries with sweeping surveillance capabilities.”

The groups called the new data-retention policy in the bill “clearly excessive and unjustified.” If passed, the measure would require French telecom companies to retain communications for up to eight years.

In a statement that echoed concerns about the growing scope of U.S. government surveillance, the civil-liberties coalition wrote that the bill’s “broad language leaves room for the future use of undefined surveillance technologies which could lead to an extension of the scope of the bill without any involvement of democratic institutions.”

Eric Geller is a politics reporter who focuses on cybersecurity, surveillance, encryption, and privacy. A former staff writer at the Daily Dot, Geller joined Politico in June 2016, where he's focused on policymaking at the White House, the Justice Department, the State Department, and the Commerce Department.