WASHINGTON — James Risen, a New York Times reporter, will not be called to testify at a leak trial scheduled to begin this week, lawyers said Monday, ending a seven-year legal fight over whether he could be forced to identify his confidential sources.

The Justice Department wanted Mr. Risen to testify at the trial of Jeffrey Sterling, a former C.I.A. officer charged with providing him details about a botched operation in Iran that was intended to disrupt that country’s nuclear program. Mr. Sterling had raised concerns inside the government about the program, and prosecutors suspect he took those concerns to Mr. Risen, who described the program in his 2006 book, “State of War.”

Mr. Risen, a two-time Pulitzer Prize winner, was the highest-profile journalist drawn into the Obama administration’s attempt to crack down on government officials who talk to reporters about national security. The Justice Department has brought more charges in leak cases than were brought in all previous administrations combined. The case became a rallying cry for journalism groups and civil rights advocates. Mr. Risen took his fight to the Supreme Court and lost, but Attorney General Eric H. Holder Jr. ultimately said prosecutors would not force him to reveal his sources.

“We said from the very beginning that under no circumstances would Jim identify confidential sources to the government or anyone else,” Mr. Risen’s lawyer, Joel Kurtzberg, said. “The significance of this goes beyond Jim Risen. It affects journalists everywhere. Journalists need to be able to uphold that confidentiality in order to do their jobs.”