The United States has announced charges against two Russian security services officers and two alleged hackers, accusing them of a mega data breach at Yahoo that affected at least a half billion user accounts.

Officials said the hack targeted the email accounts of Russian and US officials, Russian journalists, employees of financial services and other businesses.

The charges arise from a compromise of Yahoo user accounts that began at least as early as 2014.

Though the Justice Department has previously charged Russian hackers with cybercrime - as well as hackers sponsored by the Chinese and Iranian governments - this is the first criminal case brought against Russian government officials.