WASHINGTON -- The Senate has voted to confirm Chuck Hagel to be the nation's next defense secretary.

The vote Tuesday was 58-41, with four Republicans joining Democrats in backing President Barack Obama's nominee.

The vote ended a contentious fight over the president's choice for his second-term national security team.

Republicans opposed the former two-term Republican senator from Nebraska, casting him as out of the mainstream and overly critical of Israel. But Democrats stood together for Hagel, a twice-wounded Vietnam combat veteran.

Hagel will succeed Defense Secretary Leon Panetta, who is stepping down after four years as CIA director and Pentagon chief.

The vote came just hours after Republicans dropped their delay and allowed the nomination to move forward. The Senate vote to end the filibuster was 71-27.