The U.S. House of Representatives voted on Monday to require law enforcement authorities to obtain a search warrant before seeking old emails from technology companies, a win for privacy advocates fearful the Trump administration may work to expand government surveillance powers.
The House passed the measure by a voice vote. But the legislation was expected to encounter resistance in the Senate, where it failed to advance last year amid opposition by a handful of Republican lawmakers after the House passed it unanimously.
Technology companies such as Microsoft (msft) have lobbied Congress for years to pass the Email Privacy Act, which updates a decades-old law to force authorities to first get a warrant to access emails or other digital communications that are at least 180 days old.
Currently, agencies such as the Justice Department and the Securities and Exchange Commission only need a subpoena, which is subject to less judicial oversight than a warrant, to seek such data from a service provider—a standard that has existed since the Electronic Communications Privacy Act (ECPA) was adopted in 1986.
Supporters of the bill passed Monday say it is needed to update an out-of-date law conceived and written before the rise of the commercial Internet.
Get Data Sheet, Fortune's technology newsletter.
Richard Salgado, director of law enforcement and information security at Google (goog), said in a statement the measure would "fix a constitutional flaw" in the ECPA. "While there are disagreements about other aspects of surveillance reform, there is no disagreement that emails and electronic content deserve Fourth Amendment protections," he said.
But some senators, including No. 2 Republican John Cornyn, last year sought to use the legislation as a vehicle for amendments that would expand the FBI's domestic surveillance capabilities, effectively killing the bill.
Debate over law enforcement access to Americans' electronic communications intensified last year when the FBI sought a court order to make Apple (aapl) help unlock an encrypted iPhone linked to one of the shooters behind a deadly attack in San Bernardino, Calif.
Privacy advocates have expressed alarm at President Donald Trump's ability to expand government spying. The Republican campaigned on a "law and order" platform that included suggestions he may want to place some mosques in the United States under surveillance and maintain a national database on Muslims.
Microsoft last year filed a federal lawsuit against the Justice Department over ECPA, alleging that the government's use of the law violated the U.S. constitution.
It argued that ECPA is too often used to prevent companies from notifying its users, sometimes indefinitely, when investigators pry into emails and other data stored on remote servers.