After a bruising confirmation battle, the Senate on Tuesday cleared former Sen. Chuck Hagel to become secretary of defense by an historically slim margin.

Hagel, 66, who until 2009 represented Nebraska in the Senate, was confirmed by a 58-41 vote and will succeed Leon Panetta. His first order of business will be to guide the nation's military through unprecedented spending cuts that are all but certain to take place under a looming March 1 budget sequester.

Many defense experts have warned that the cuts, amounting to $85 billion in nondiscretionary federal spending this year, more than half targeting the Pentagon, will hobble the military.

"It is my hope that Sen. Hagel will not want to be known as the secretary of defense responsible for overseeing the gutting of our military and instead will step up and exhibit the leadership necessary to avert this unacceptable outcome," said Sen. James Inhofe, R-Okla, who was perhaps the Senate's chief opponent to Hagel's nomination.

Most GOP senators voted against Hagel on Tuesday because of statements he has made regarding Israel and Iran, as well as his stumbling performance at a Jan. 31 confirmation hearing.

During that hearing, Hagel had to be corrected twice about the U.S. stance against allowing Iran to obtain nuclear weapons. Later, he referred to Iran as having "an elected legitimate government." He told the confirmation panel he regretted his past comment about an intimidating "Jewish lobby" on Capitol Hill.

Opposition to Hagel grew quickly among GOP senators, and they managed to filibuster his nomination in early February while they pressured Hagel to turn over more documents. Senators also used Hagel's nomination as a bargaining chip to force the White House to hand over documents related to the Sept. 11, 2012 attack on the U.S. consulate in Benghazi, Libya, which left the ambassador and three other Americans dead.

But most in the GOP were opposed to permanently filibustering a presidential Cabinet pick, and on Monday they agreed to end debate on Hagel. The move cleared the way for a simple majority vote that assured his confirmation in the Senate, where Democrats control 55 votes.

Republicans warned that Hagel comes to the job as damaged goods.

"He will take office with the weakest support of any defense secretary in modern history," Sen. John Cornyn, R-Texas, said, "which will make him less effective on the job."

A group of Senate Republicans sent a letter to President Obama earlier this month telling him that no defense secretary has ever been confirmed with more than three senators voting against him.

But Democrats on Tuesday said they were not concerned about Hagel's GOP opposition or fears that Hagel is ill-equipped for the job.

"He's been through a political rough-and-tumble much of his whole life," Sen. Carl Levin, D-Mich., who chairs the Senate Armed Services Committee, told The Washington Examiner. "He's going to put this aside and focus on what the prize is, which is American security, threats that it faces, and how do you address those and the current budget situation. That would be his focus if this vote was 99-1."

President Obama praised Hagel's confirmation, citing his service as a decorated Vietnam War veteran.

"An American patriot who fought and bled for our country, he understands our sacred obligations to our service members, military families and veterans," Obama said.