WASHINGTON - President Bush said yesterday that his confidence in Alberto R. Gonzales had grown as a result of his testimony last week before the Senate Judiciary Committee, as the administration moved to end speculation that the attorney general would step down after a performance criticized by senators in both parties.

"The attorney general went up and gave a very candid assessment and answered every question he could possibly answer, in a way that increased my confidence in his ability to do the job," Bush told reporters in the Oval Office. "Some senators didn't like his explanation, but he answered as honestly as he could."

Soon after Bush spoke, Gonzales went before reporters and said he had no plans to resign. "I will stay as long as I feel I can be effective," he said at a news conference to discuss identity theft, "and I believe I can be effective."

Taken together, White House advisers and consultants said, the comments suggested that Bush intended to try to ride out the storm over Gonzales despite qualms among Republican lawmakers and even some of his own aides.

"He's staying," White House spokeswoman Dana Perino told reporters.

Leading Republicans continued to express doubt that Gonzales was up to the job in light of his contradictory explanations for the firing last year of eight U.S. attorneys. Sen. Arlen Specter of Pennsylvania, the ranking Republican on the Judiciary Committee, told reporters in Harrisburg that keeping Gonzales as attorney general would be "harmful to the Justice Department because he has lost his credibility."

The White House appears to have concluded that Gonzales has done nothing to merit firing and that letting him go would create more political problems for the administration. Bush also seemed to be digging in against the proposition that his appointments can be dictated from Capitol Hill.

"U.S. attorneys serve at the pleasure of the president," Bush told reporters during a brief photo opportunity with Gen. David Petraeus. "In other words, we have named them, and I have the right to replace them with somebody else."

A Gonzales departure could wreak further havoc in the upper ranks of the Justice Department, which has been fractured by the controversy.

But some Justice Department officials worry privately that the department will be unable to move past the firings controversy unless Gonzales leaves.