China-based hackers are suspected of breaking into the computer networks of the US government personnel office and stealing identifying information of at least four million federal workers, officials have said.
The Department of Homeland Security (DHS) said in a statement that data from the Office of Personnel Management (OPM) and the Interior Department had been compromised.
"The FBI is conducting an investigation to identify how and why this occurred," the statement said.
The hackers were believed to be based in China, said Republican senator Susan Collins.
Ms Collins, a member of the Senate intelligence committee, said the breach was "yet another indication of a foreign power probing successfully and focusing on what appears to be data that would identify people with security clearances".
A US official, who declined to be named, said it could potentially affect every federal agency.
One key question is whether intelligence agency employee information was stolen. Former government employees are affected as well.
"This is an attack against the nation," said Ken Ammon, chief strategy officer of Xceedium, who said the attack fit the pattern of those carried out by nation states for the purpose of espionage. The information stolen could be used to impersonate or blackmail federal employees with access to sensitive information, he said.
The OPM is the human resources department for the federal government, and it conducts background checks for security clearances. The OPM conducts more than 90% of federal background investigations, according to its website.
The agency said it is offering credit monitoring and identity theft insurance for 18 months to individuals potentially affected.
The National Treasury Employees Union, which represents workers in 31 federal agencies, said it is encouraging members to sign up for the monitoring as soon as possible.
In November, a former DHS contractor disclosed another cyberbreach that compromised the private files of more than 25,000 DHS workers and thousands of other federal employees.
Cyber-security experts also noted that the OPM was targeted a year ago in a cyber-attack that was suspected of originating in China. In that case, authorities reported no personal information was stolen.
One expert said it is possible that hackers could use information from government personnel files for financial gain.
In a recent case disclosed by the Inland Revenue Service, hackers appear to have obtained tax return information by posing as taxpayers, using personal information gleaned from previous commercial breaches, said Rick Holland, an information security analyst at Forrester Research.
"Given what OPM does around security clearances, and the level of detail they acquire when doing these investigations, both on the subjects of the investigations and their contacts and references, it would be a vast amount of information," Holland added.
DHS said its intrusion detection system, known as Einstein, which screens federal internet traffic to identify potential cyber threats, identified the hack of OPM's systems and the Interior Department's data centre, which is shared by other federal agencies.
It was unclear why the Einstein system did not detect the breach until after so many records had been copied and removed.
"DHS is continuing to monitor federal networks for any suspicious activity and is working aggressively with the affected agencies to conduct investigative analysis to assess the extent of this alleged intrusion," the statement said.
Representative Adam Schiff, ranking Democrat on the House intelligence committee, called the hack "shocking, because Americans may expect that federal computer networks are maintained with state of the art defences".
Mr Ammon said federal agencies are rushing to install two-factor authentication with smart cards, a system designed to make it harder for intruders to access networks. But implementing that technology takes time.