WASHINGTON — An intensive drive by right-wing Republicans in Congress to vilify the FBI with charges of political bias has imperiled a program allowing spy agencies to conduct warrantless surveillance on foreign targets, sapping support for a premier intelligence tool and amplifying demands for stricter limits.

The once-secret program — created after the 9/11 attacks and described by intelligence officials as crucial to stopping overseas hackers, spy services and terrorists — has long faced resistance by Democrats concerned that it could trample on Americans’ civil liberties. But the law authorizing it is set to expire in December, and opposition among Republicans, who have historically championed it, has grown as the GOP has stepped up its attacks on the FBI, taking a page from former President Donald Trump and his supporters.

“There’s no way we’re going to be for reauthorizing that in its current form — no possible way,” said Rep. Jim Jordan, R-Ohio, a key ally of Trump’s who is leading a special House investigation into the “weaponization” of government against conservatives. “We’re concerned about surveillance, period.”

At issue is a program that allows the government to collect — on domestic soil and without a warrant — the communications of targeted foreigners abroad, including when those people are interacting with Americans. Leaders of both parties have warned the Biden administration that Congress will not renew the law that legalized it, known as Section 702, without changes to prevent federal agents from freely searching the email, phone and other electronic records of Americans in touch with surveilled foreigners.

Since the program was last extended in 2018, the GOP’s approach to law enforcement and data collection has undergone a dramatic transformation. Disdain for the agencies that benefit from the warrantless surveillance program has moved into the party mainstream, particularly in the House, where Republicans assert that the FBI’s investigations of Trump were biased and complain of a broader plot by the government to persecute conservatives — including some of those charged in storming the Capitol on Jan. 6, 2021 — for their political beliefs. They argue that federal law enforcement agencies cannot be trusted with Americans’ records and should be prevented from accessing them.

“You couldn’t waterboard me into voting to reauthorize 702,” said Rep. Matt Gaetz, R-Fla., who backed the program in 2018. “These 702 authorities were abused against people in Washington on January 6, and they were abused against people who were affiliated with the BLM movement, and I’m equally aggrieved by both of those things.”

Congress created Section 702 of the Foreign Intelligence Surveillance Act in 2008 and has renewed the program twice since, largely thanks to the overwhelming support of Republican lawmakers. But significant turnover on Capitol Hill has brought a new generation of Republicans less protective of Washington’s post-9/11 counterterrorism powers, and about half of House Republicans have never cast a vote on it.

“This will be a first impression for many of them,” said Rep. Darin LaHood, R-Ill., a supporter of the program who is part of the Intelligence Committee’s six-member working group trying to determine how Congress can restrict the program without hamstringing it. “The thought that 702 and FISA just focused on terrorism — I think that narrative has to be changed. We need to focus on China, we need to focus on Russia, we need to focus on Iran and North Korea.”

The Biden administration has been making a similar case to lawmakers, appealing to them to renew the Section 702 program, which National Security Adviser Jake Sherman has said was “crucial” to heading off national security threats from China, Russia, cyberattacks and terrorist groups.

But far-right lawmakers have embarked on a louder and more politically loaded effort to fight the measure.

They have seized on official determinations that federal agents botched a wiretap on a Trump campaign adviser and more recent disclosures that FBI analysts improperly used Section 702 to search for information about hundreds of Americans who came under scrutiny in connection with the Jan. 6 attack and the Black Lives Matter protests after the 2020 murder of George Floyd by a police officer.

Justice Department and FBI officials have attempted to defend themselves from lawmakers’ outrage over those revelations, pointing to steps they have taken to restrain the opportunities agents are permitted to examine the communications of Americans collected under Section 702. They credit those changes with reducing the number of such queries from about 3 million in 2021 to about 120,000 last year.

In recent years, Capitol Hill has welcomed several new Democrats with backgrounds in national security who favor extending the program. But convincing others is a challenge, as most members of the party — including Rep. Hakeem Jeffries of New York, the minority leader — have voted against extensions.