The United States is pulling spies from China as a result of a cyberattack that compromised the personal data of 21.5 million government workers, a U.S. official said Tuesday.

The U.S. suspects that Chinese hackers were behind the breach at the U.S. Office of Personnel Management, which exposed the fingerprints of 5.6 million government employees.

Because the stolen data includes records on State Department employees, the hackers could, by process of elimination, identify embassy personnel who are actually intelligence agents.

Employees of the Central Intelligence Agency, National Security Agency and Defense Intelligence Agency assigned to China are at risk of being exposed, U.S. intelligence officials determined in recent months. The Washington Post reported Tuesday that the CIA has pulled a number of officers from the U.S. Embassy in Beijing.

The hack is expected to have a major impact on U.S. national security, in part because the stolen data includes information from U.S. government forms used for security clearances, known as SF86 questionnaires.

The forms contain sensitive private information on current, former and even prospective government employees, as well as their family members and associates, U.S. officials said.

The concern now is that Chinese intelligence could use the OPM data to help determine the identities of future U.S. intelligence employees that may try to enter China. Beijing is known to scrutinize visa applications of people with U.S. ties, based on travel patterns and other data.

Even before the hack, technology advancements in biometrics made it difficult for the CIA to infiltrate operatives pretending to be someone else into China and other countries.

The CIA is now pushing to improve its technological spying capabilities to fill the void.

In Washington on Tuesday, Republican senators pushed Director of National Intelligence James Clapper to explain why the Obama administration hasn't responded more firmly to the hack.

Clapper acknowledged that one reason the U.S. hasn't responded is because the U.S. engages in the same type of espionage. "We're not bad at it," he said.

Beijing has long denied it is involved in hacking, and often claims to be a victim of similar attacks. Hong Lei, a spokesman for the Chinese Ministry of Foreign Affairs, reiterated that position on Wednesday.

"The Chinese government firmly opposes any forms of hacking," he said, noting the U.S. and China agreed just days ago not to conduct cybertheft of trade secrets and intellectual property against one another for commercial gain.