President Bush thanked the Senate, even though the margin had been whittled down from nearly unanimous by a sharp debate over Mukasey's refusal to say whether the waterboarding interrogation technique is torture.
"He will be an outstanding attorney general," Mr. Bush said in a statement from his ranch in Crawford, Texas.
Republicans were solidly behind Mr. Bush's nominee. Democrats said their votes were not so much for Mukasey as they were for restoring a leader to a Justice Department left adrift after Gonzales' resignation in September.
In the end, Mukasey was confirmed as the nation's 81st attorney general by a 53-40 vote. Six Democrats and one independent joined Republicans in sealing his confirmation.
The choice, according to one of those Democrats, was essentially between "whether to confirm Michael Mukasey as the next attorney general or whether to leave the Department of Justice without a real leader for the next 14 months," said Sen. Dianne Feinstein of California.
"This is the only chance we have," she said, referring to Bush's threat to appoint an acting attorney general not subject to Senate confirmation.
But members of her own party didn't agree. Mukasey, his opponents argued, refused to say whether waterboarding is torture and put the onus on Congress to pass a law against the practice.
"This is like saying when somebody murders somebody with a a baseball bat and you say, 'We had a law against murder but we never mentioned baseball bats,"' said Judiciary Committee Chairman Patrick Leahy, D-Vt. "Murder is murder. Torture is torture."
Being better than Gonzales or an acting attorney general is not enough qualification for the job, said Sen. Edward M. Kennedy, D-Mass.
"The next attorney general must restore confidence in the rule of law," he said. "We cannot afford to take the judgment of an attorney general who either does not know torture when he sees it or is willing to look the other way."
The confirmation vote capped 10 months of scandal and resignations at the Justice Department. Mukasey's chief Democratic patron, Sen. Chuck Schumer, D-N.Y., drove the probe into the purge of nine federal prosecutors that helped push Gonzales out.
The debate came after a tense day of negotiations that at one point featured Majority Leader Harry Reid threatening to postpone Mukasey's confirmation until December. His confirmation had long been certainty despite the debate over waterboarding.
Waterboarding, used by interrogators to make someone feel as if he is going to drown, is banned by domestic law and international treaties. But U.S. law applies to Pentagon personnel and not the CIA. The administration won't say whether it has allowed the agency's employees to use it against terror detainees.
"The United States will not be viewed kindly if we confirm as chief law enforcement officer of this country someone who is unwilling or unable to recognize torture when he sees it," said Sen. Dick Durbin of Illinois, the Senate's No. 2 Democrat.