When the US National Security Agency (NSA) intercepted the online accounts of legally targeted foreigners over a four-year period it also collected the conversations of nine times as many ordinary internet users, both Americans and non-Americans, according to an investigation by the Washington Post.

Nearly half of those surveillance files contained names, email addresses or other details that the NSA marked as belonging to US citizens or residents, the Post reported in a story posted on its website on Saturday night. While the federal agency tried to protect their privacy by masking more than 65,000 such references to individuals, the newspaper said it found nearly 900 additional email addresses that could be strongly linked to US citizens or residents.

The intercepted messages contained material of considerable intelligence value, the Post reported, such as information about a secret overseas nuclear project, double-dealing by an ostensible ally, a military calamity that befell an unfriendly power and the identities of aggressive intruders into US computer networks.

As an example, the newspaper said the files showed that months of tracking communications across dozens of alias accounts led directly to the capture in 2011 of a Pakistan-based bomb builder suspected in a 2002 terrorist bombing in Bali. The Post said it was withholding other examples, at the request of the CIA, that would compromise ongoing investigations.

The material reviewed by the Post included roughly 160,000 intercepted email and instant-message conversations, some of them hundreds of pages long, and 7,900 documents taken from more than 11,000 online accounts. It spanned president Barack Obama's first term, 2009 to 2012, and was provided to the Post by the former NSA analyst Edward Snowden.

The daily lives of more than 10,000 account holders who were not targeted were catalogued and recorded, the Post reported. The newspaper described that material as telling "stories of love and heartbreak, illicit sexual liaisons, mental-health crises, political and religious conversions, financial anxieties and disappointed hopes".

The material collected included more than 5,000 private photos, the paper said.

The cache Snowden provided to the newspaper came from domestic NSA operations under the broad authority granted by Congress in 2008 with amendments to the Foreign Intelligence Surveillance Act, according to the Post.

By law, the NSA may "target" only foreign nationals located overseas unless it obtains a warrant based on probable cause from a special surveillance court, the Post said. "Incidental collection" of third-party communications is inevitable in many forms of surveillance, according to the newspaper.

In the case of the material Snowden provided, those in an online chat room visited by a target or merely reading the discussion were included in the data sweep, as were hundreds of people using a computer server whose internet protocol was targeted.