A Yahoo logo is seen on top of the building where they have offices in New York City / REUTERS/Brendan McDermid

The news comes amid heightened tensions between the US and Russia

The US has charged two Russian spies with the biggest cyber attack ever carried out.

The Department of Justice said that two "state-sponsored" Russian hackers were responsible for breaking into Yahoo and stealing 500 million accounts. The case would be the first ever brought against Russian officials.

The charge comes amid increasing tensions between Russia and the US over the use cyber weapons and hacking. Multiple US intelligence agencies have accused Russian state-sponsored hackers of running a co-ordinated campaign to upset the result of the US election and increase the chances that Donald Trump would become president.

In all, four people have been charged by the US over the Yahoo attack, according to reports. Two of those people are members of the Russian security services, and one of the defendants has been taken into custody in Canada.

The US Justice Department is expected to announce the details of the indictments later on Wednesday. It isn't clear, for instance, whether the officials are being charged with being involved in both of the major hacks or just one of them.

The Washington Post reported earlier that the two spies and two hackers would be charged in connection with the 2014 attack. That was separate from a later breach that took even more accounts and would take its crown as the biggest cyber attack in the world.