WASHINGTON (AP) -- A deeply divided Senate voted on Tuesday to confirm Republican Chuck Hagel to be the nation's next defense secretary, handing President Barack Obama's pick the top Pentagon job just days before billions of dollars in automatic, across-the-board budget cuts hit the military.
The vote was 58-41, with four Republicans joining the Democrats in backing the contentious choice. Hagel's only GOP support came from former colleagues Thad Cochran of Mississippi, Dick Shelby of Alabama and Mike Johanns of Nebraska -- all three had announced their support earlier -- and Rand Paul of Kentucky.
The vote came just hours after Republicans dropped their unprecedented delay of a Pentagon choice and allowed the nomination to move forward on a 71-27 vote.
Hagel, 66, a former two-term Nebraska senator and twice-wounded Vietnam combat veteran, succeeds Defense Secretary Leon Panetta. Hagel is expected to be sworn in at the Pentagon on Wednesday.
Obama welcomed the bipartisan Senate vote, although 41 Republicans opposed his nominee, and said in a statement that "we will have the defense secretary our nation needs and the leader our troops deserve."
The looked past the divisions and said he was grateful to Hagel "for reminding us that when it comes to our national defense, we are not Democrats or Republicans, we are Americans, and our greatest responsibility is the security of the American people."
Republicans had opposed their onetime colleague, casting him as unqualified for the job, hostile toward Israel and soft on Iran. The objections remained strong well after the vote.
"I continue to have serious questions about whether Chuck Hagel is up to the job of being our secretary of defense," Sen. Lindsey Graham, R-S.C., said in a statement. "I hope, for the sake of our own national security, he exceeds expectations."
Hagel joins Obama's retooled second-term, national security team of Secretary of State John Kerry and CIA Director-designate John Brennan at a time of uncertainty for a military emerging from two wars and fighting worldwide terrorism with smaller, deficit-driven budgets.
Among his daunting challenges are deciding on troop levels in Afghanistan as the United States winds down its combat presence and dealing with $46 billion in budget cuts set to kick in on Friday. He also will have to work with lawmakers who spent weeks vilifying him.
Republicans insisted that Hagel was battered and bloodied after their repeated attacks during the protracted political fight.
"He will take office with the weakest support of any defense secretary in modern history, which will make him less effective on his job," said Sen. John Cornyn of Texas, the Senate GOP's No. 2 Republican.
Not so, said Democratic Sen. Jack Reed, who pointed out that Hagel now has the title and the fight is history.
"All have to work together for the interest of the country," said Reed, D-R.I.
The vote ended one of the most bitter fights over a Cabinet choice and former senator since 1989 when the Democratic-led Senate defeated newly elected President George H.W. Bush's nomination of Republican John Tower to be defense secretary.
In the course of the rancorous, seven-week nomination fight, Republicans, led by freshman Sen. Ted Cruz of Texas and Sen. Jim Inhofe of Oklahoma, insinuated that Hagel has a cozy relationship with Iran and received payments for speeches from extreme or radical groups. Those comments drew a rebuke from Democrats and some Republicans.
Sen. Carl Levin, D-Mich., the chairman of the Armed Services Committee, dismissed the "unfair innuendoes" against Hagel and called him an "outstanding American patriot" whose background as an enlisted soldier would send a positive message to the nation's servicemen and women.
Sen. Claire McCaskill, D-Mo., questioned how the confirmation process devolved into a character assassination in which Hagel was accused of "having secret ties with our enemies."
"I sincerely hope that the practice of challenging nominations with innuendo and inference, rather than facts and figures, was an aberration and not a roadmap," she said in a statement after the vote.
Obama got no points with the GOP for tapping the former two-term Republican senator. GOP lawmakers excoriated Hagel and cast him as a radical far out of the mainstream.
Sen. John McCain, R-Ariz., clashed with his onetime friend over his opposition to President George W. Bush's decision to send an extra 30,000 troops to Iraq in 2007 at a point when the war seemed in danger of being lost. Hagel, who voted to authorize military force in Iraq, later opposed the conflict, comparing it to Vietnam and arguing that it shifted the focus from Afghanistan.