The Stuxnet computer virus deployed against Iran's nuclear enrichment facilities was only one part of U.S. President Barack Obama's broader plan to expand his country's use of cyberweapons, alleges a new book by New York Times chief Washington correspondent David E. Sanger.

In an excerpt from the book, which comes out Tuesday, published in the New York Times last week, Sanger says Obama decided to accelerate cyberattacks begun under the previous administration of George W. Bush.

The plan to target the nuclear-enrichment facility near the Iranian city of Natanz, codenamed Olympic Games, was hatched by the Bush administration in 2006 but carried out by Obama several years later, writes Sanger in Confront and Conceal: Obama’s Secret Wars and Surprising Use of American Power.

The Stuxnet worm itself was developed by programmers in the National Security Agency in co-operation with a technical unit of the Israeli military, Sanger writes.

The veteran journalist spent 18 months interviewing current and former officials involved in the cyberweapon program from the U.S., Europe and Israel as well as outside experts. None of his sources agreed to have their names published.

The book traces the development of the computer virus, which experts say was 50 times bigger than a typical piece of malware, and its deployment against the tightly guarded system that operates the centrifuges at the Natanz plant.

Sanger's sources allege Stuxnet was first tested on U.S. soil using decommissioned centrifuges that the late Libyan leader Moammar Gadhafi had turned over to the U.S. in 2003 when ending Libya's nuclear program.

2010 leak threatened covert program

Sanger reveals that in 2010 when the Stuxnet worm escaped the confines of the Natanz plant because of a programming error and began showing up on computers around the world, Obama briefly considered scuppering the whole program but was convinced by advisers that the virus was doing enough damage to continue with it and another version of the worm was eventually deployed.

Although Iran and some experts dispute the claims, Sanger's sources allege Stuxnet was eventually responsible for temporarily taking out several thousand centrifuges and setting back Iran's nuclear-enrichment program by one and a half to two years

The book comes out just a week after the world learned of yet another massive piece of malware dubbed Flame, which is even more powerful than Stuxnet but which Sanger's sources say was not part of the Olympic Games operation.

The U.S. has not said whether it was behind the Flame attacks and has never admitted responsibility for the Stuxnet worm, although it has acknowledged developing cyberweapons.

In the book, Sanger says Obama's main motivation for deploying the Stuxnet worm was to stave off a military attack by Israel and find ways to disrupt its nuclear program that would have less damaging geopolitical consequences.