A US law enforcement official has said a foreign entity or government is believed to be behind a major US government data breach.

Earlier, the US government agency that collects personnel information for federal employees admitted the cyber security breach, which compromised the data of four million people.

The Office of Personnel Management said the cyber security breach affected data for current and former federal employees.

The OPM said: "As a result of the incident (the office) will send notifications to approximately four million individuals."

It detected new malicious activity affecting its information systems in April and the Department of Homeland Security said it concluded at the beginning of May that the agency's data had been compromised.

The breach affected OPM's IT systems and its data stored at the Department of the Interior's data centre, which is a shared service center for federal agencies, a DHS official said on condition of anonymity.

OPM had previously been the victim of a cyber attack, as have various federal government computer systems at the State Department, the US Postal Service and the White House.

The FBI is said to be investigating the breach.

Since the intrusion, OPM said it had implemented additional security precautions for its networks. 

Meanwhile, US President Barack Obama has approved giving the National Security Agency wider powers to spy on Internet traffic in search of computer hacking by foreign governments or others, US media has reported Thursday, citing classified documents.

The expanded authority was granted by the Justice Department in two 2012 memos that permit the NSA to sift through online data without a warrant to uncover possible malware or other cyber intrusions linked to foreign powers, according to the New York Times and ProPublica.