By EVAN PEREZ WASHINGTON—Attorney General Eric Holder on Friday night appointed two top prosecutors to lead a probe into recent leaks about classified U.S. operations, following a week in which Republican lawmakers questioned whether the leaks were politically motivated.

Ronald Machen, U.S. attorney for the District of Columbia, and Rod Rosenstein, U.S. attorney for Maryland, will head the probe, Mr. Holder said Friday.

"I have every confidence in their abilities to doggedly follow the facts and the evidence in the pursuit of justice wherever it leads," Mr. Holder said.

He added, "The unauthorized disclosure of classified information can compromise the security of this country and all Americans, and it will not be tolerated."

The naming of the prosecutors follows publication a week ago of details about a U.S. cybersabotage program, including the use of a computer worm called Stuxnet, which Iran has acknowledged it found in its computers.

The Central Intelligence Agency ran the operation in conjunction with Idaho National Laboratory, the Israeli government and other U.S. agencies, according to people familiar with the efforts.

The New York Times on June 1 published an account of the U.S. cyberattack operation in an excerpt from a forthcoming book by one of its reporters, David Sanger. He said he had been working on the book for a year. Other news organizations, including The Wall Street Journal, followed up with details about the program.

Earlier Friday, President Barack Obama said the White House didn't deliberately leak classified information. "The notion that my White House would purposely release classified national-security information is offensive," Mr. Obama said at a briefing with reporters. "It's wrong." He added that "if we can root out folks who have leaked, they will suffer consequences."

Sens. John McCain (R., Ariz.) and Saxby Chambliss (R., Ga.), in speeches on the Senate floor Tuesday, called for the president to appoint a special counsel to investigate what Mr. Chambliss called "a pattern of leaks."

Earlier this week, the Federal Bureau of Investigation opened an investigation into the leaks about the cyberattack program.

The FBI has said it is also conducting an investigation into revelations about a double agent who infiltrated al Qaeda's Yemen affiliate. FBI Director Robert Mueller told lawmakers recently the FBI was looking into how news leaked about the double agent and a new-generation underwear bomb the al Qaeda affiliate had hoped to use in an airliner attack.

The Associated Press, which first reported the Yemen news, has said it held the news for several days at the government's request.