The FBI was able to "detect and thwart" Chinese hackers attempting to access U.S. critical infrastructure, as well as malign threats from other adversaries, under Section 702 of the Foreign Intelligence Surveillance Act, FBI Director Christopher Wray said Friday in a letter to Congress defending the law.

Fox News Digital obtained letters Wray sent to House Speaker Kevin McCarthy, R-Calif., and Senate Majority Leader Chuck Schumer, D-N.Y., on Friday highlighting the positives of the surveillance tool amid significant reforms the bureau has made under his leadership.

The letters come on the same day the FISA Court released its 2023 opinion, which said a U.S. senator and a state senator were queried under FISA Section 702 in June 2022, and a state judge was queried in October 2022 — demonstrating a "failure" to follow FBI policy.

The opinion, though, said "the FBI has been doing a better job in applying the querying standard," and said its compliance rate with that standard is more than 98%, after the implementation of reforms.

FISA COURT OPINION REVEALS A US SENATOR, STATE SENATOR, STATE JUDGE GOT SWEPT UP IN 702 QUERIES

FBI Director Christopher Wray

FBI Director Christopher Wray speaks during a news conference in Omaha, Nebraska, on Aug. 10, 2022. (AP Photo/Charlie Neibergall)

Wray's letters highlighted the successes the bureau has had in combating threats, using the tool of Section 702, which will sunset on Dec. 31 and requires congressional reauthorization.

"Section 702’s critical importance to our national security has only grown with the evolution of technology and threats. Without Section 702 we would be unable to plug a critical intelligence gap — one that foreign threat actors regularly exploit as they traverse computer networks and electronic service providers to conduct cyberattacks, espionage campaigns, or coordinate with likeminded terrorists," Wray wrote.

Wray called Section 702 "invaluable" to the FBI’s ability to "know what our foreign adversaries are doing and how they are doing it — intelligence without which we could not protect Americans or the homeland."

Section 702 of Foreign Intelligence Surveillance Act (FISA) allows the government to conduct targeted surveillance of non-U.S. citizens located abroad to acquire foreign intelligence information. When U.S. citizens are flagged as part of these investigations, the FBI takes over the process of querying them for possible security reasons.

Wray outlined specific examples, including that the tool has been "pivotal for the FBI to detect and thwart Chinese hackers attempting to access U.S. critical infrastructure."

FBI IMPROPERLY USED WARRANTLESS SEARCH POWERS MORE THAN 278,000 TIMES IN 2021, FISA COURT FILING REVEALS

Wray said the intelligence community has assessed that China is attempting to "preposition" on U.S. critical infrastructure in an effort to set up "backdoors to cripple" that infrastructure "in the event China invades Taiwan," which he said would limit the U.S.’ ability to assist the small island nation.

"Section 702 allows us to detect these hackers by monitoring them as they traverse the internet and determine when they access networks within the United States," Wray wrote. He said using queries for the "identifiers of potential victims," which he says some are American businesses, allows the FBI to see "whether the hackers are merely researching a victim for future attacks or if they have already compromised the systems."

FBI Director Christopher Wray

FBI Director Christopher Wray testifies during the Senate Judiciary Committee hearing titled "Oversight of the Federal Bureau of Investigation" in the Hart Building in Washington, D.C., on Aug. 4, 2022. (Tom Williams/CQ-Roll Call, Inc via Getty Images)

Wray said the FBI was able to identify Chinese hackers gaining access to computer networks of a major U.S. transportation hub.

"Along with impeding our ability to assist Taiwan in case of an attack, such Chinese intrusions are meant to wreak havoc with the everyday lives of Americans, and they have the potential to cause millions (possibly billions) of dollars in damage to industry," he wrote, adding that these targets can "potentially jeopardize the physical safety of Americans."

Wray said without the intelligence gathered through FISA Section 702, the FBI "would be blinded to such malicious actions from China-based hackers and unable to counter them."

ODNI REPORT REVEALS 'SIGNIFICANT DECLINE' IN FBI QUERIES OF US CITIZENS UNDER FISA 702 LAST YEAR

Wray also pointed to Iran’s bolstered cyber capabilities — specifically referencing its cyberattack on the Boston Children’s Hospital in 2021.

"Iran, along with North Korea, is one of only two nation-states known to have conducted destructive cyberattacks within the United States," he wrote.

FBI logo

The FBI seal is displayed on a podium before a news conference at the agency's headquarters in Washington, D.C. (AP Photo/Jose Luis Magana, File)

"Iran has sought to assassinate American citizens, including high-level government officials," Wray said, referring to Iran’s effort to target former Secretary of State Mike Pompeo and former U.S. National Security Adviser John Bolton.

"Section 702 collection and U.S. persons queries helped us connect the dots," he said. "We were able to warn the victim and his former Department, and as a result they were able to take proactive steps to protect him."

JORDAN SAYS FBI SHOULD BE KICKED OUT OF PROBES INTO US CITIZENS FLAGGED IN FISA INVESTIGATIONS

Wray said the FBI "needs Section 702 to keep countering the next five years of foreign threats — stopping international terrorists plotting with collaborators to launch terrorist attacks, disrupting foreign cyber actors trying to hold our government, our people, and our businesses hostage, and preparing to meet the new threats all of these adversaries constantly seek to bring to the homeland."

CLICK HERE TO GET THE FOX NEWS APP

Wray said the FBI looks forward to working with Congress to "highlight the value of this important authority to the American public and how we can become the best stewards of this vital source of foreign intelligence."

FISA Section 702 is set to sunset on Dec. 31, and lawmakers on both sides of the aisle are proposing reforms in order to reauthorize the section, with more congressional oversight.