(CNN) -- Chuck Hagel, the former U.S. senator from Nebraska, was sworn in as secretary of defense Wednesday after a bruising nomination fight.