After a contentious debate, the House of Representatives has voted to extend a controversial government surveillance program that powers American spying operations, as it voted down a proposal to include new privacy measures.

The debate centers on Section 702 of the Foreign Intelligence Surveillance Act, which allows for collection of foreign intelligence data, and that privacy advocates say invasively scoops up Americans’ communications. The authorization for the program is set to expire later this month, if not reauthorized. Section 702 allows the National Security Agency to continue controversial surveillance activities like PRISM, which the agency uses to scan through data held by American tech companies.

Problematic for privacy advocates is a section in the reauthorization bill that would allow for so-called “about” surveillance. For some time, the National Security Agency intercepted communications that mentioned a surveillance target, even if that information was not sent directly to or from the target. The agency recently stopped, but the bill would give the government the legal leeway to restart its efforts, so long as Congress doesn’t explicitly block them soon.

The bill was approved by a margin of 256 to 164, and will now move to the Senate.

The White House sent mixed signals on its position this week, generating confusion just before the vote. After releasing an official statement supporting the bill, the president sent a tweet Thursday morning questioning whether the Trump campaign was surveilled under the program — an accusation made without evidence. He quickly issued another tweet stepping away from the first.

“House votes on controversial FISA ACT today.” This is the act that may have been used, with the help of the discredited and phony Dossier, to so badly surveil and abuse the Trump Campaign by the previous administration and others? — Donald J. Trump (@realDonaldTrump) January 11, 2018

With that being said, I have personally directed the fix to the unmasking process since taking office and today’s vote is about foreign surveillance of foreign bad guys on foreign land. We need it! Get smart! — Donald J. Trump (@realDonaldTrump) January 11, 2018

Privacy groups and several lawmakers supported an amendment that would have ended “about” collection and tightened the requirements needed for the government to search collected data for Americans’ information. The White House’s statement — prior to Trump’s tweets — strongly opposed the amendment. “The Administration urges the House to reject this amendment and preserve the useful role FISA’s Section 702 authority plays in protecting American lives,” the White House said.

Rep. Ted Lieu (D-CA), who was critical of the bill, said on the floor that there is no “asterisk” that allows intelligence agencies to avoid complying with the Fourth Amendment. Speaker of the House Paul Ryan (R-WI) argued that the amendment would lead to the country “flying blind” in its search for terrorism suspects.

The amendment was ultimately voted down.

Should the bill now pass through the Senate and receive the president’s signature, it will allow the program to continue for another six years — more than the four years proposed by reformers. The final passage would close the door on a debate that’s been closely watched as a high-profile fight over surveillance in the post-Snowden world.