WASHINGTON — White House officials favor two primary tactics when they want to kill a news article, Condoleezza Rice, the former national security adviser, testified Thursday: They can essentially confirm the report by arguing that it is too important to national security to be published, or they can say that the reporter has it wrong.

Sitting across from a reporter and editor from The New York Times in early 2003, Ms. Rice said, she tried both.

Testifying in the leak trial of Jeffrey Sterling, a former C.I.A. officer, Ms. Rice described how the White House successfully persuaded Times editors not to publish an article about a secret operation to disrupt Iran’s nuclear program. James Risen, a Times reporter, ultimately revealed the program in his 2006 book, “State of War,” and said that the C.I.A. had botched the operation. Prosecutors used Ms. Rice’s testimony to bolster their case that the leak to Mr. Risen had harmed national security.

“This was very closely held,” Ms. Rice said. “It was one of the most closely held programs in my tenure as national security adviser.”