The US House of Representatives on Thursday voted 256 to 164 to extend the legal basis of the National Security Agency's warrantless surveillance program for an additional six years.

Section 702 of the Foreign Intelligence Surveillance Act is set to expire on January 19. The program, approved by Congress in 2008 to boost the government's ability to track foreign terrorists following 9/11, has been criticized due to the fact that collection practices also happen to capture electronic data from innocent Americans that aren't suspected of nefarious activity.

The Senate must still vote on the matter although as The New York Times highlights, fewer lawmakers there seem to favor changes to spying laws. As such, the vote isn't expected to be a hurdle for proponents of the law.

Before approving the extension, the House voted 233 to 183 to reject an amendment that would have overhauled the current program.

The extension's fate wasn't guaranteed. On Thursday morning, President Trump published a confusing tweet that seemed to question his administration's position on the matter. About 90 minutes later, the president issued a follow-up that attempted to walk back his original statement. Democrats tried to use the confusion as a way to postpone the vote but Republicans pressed ahead and conducted business as usual.