* Panetta was CIA director during bin Laden raid
* Leaves Pentagon after 19 months as defense chief
* Nominee to replace him faced harsh Senate hearing
By Phil Stewart and Roberta Rampton
WASHINGTON, Feb 8 (Reuters) - President Barack Obama bade a fond farewell to retiring U.S. Defense Secretary Leon Panetta at a ceremony on Friday and voiced strong support for his nominated successor, Chuck Hagel, who was attacked by Republicans at a contentious Senate confirmation hearing last week.
Panetta, in his 19 months as Pentagon chief, ended the ban on women serving in front-line combat roles and oversaw the integration of gays and lesbians serving openly in the military. The Iraq war ended and the last Afghanistan "surge" troops came home on his watch.
But he may be remembered most for his work before he came to the Pentagon in July 2011, as the CIA director who helped oversee the raid earlier that year that killed Osama bin Laden.
Obama noted the progress against al Qaeda under Panetta's tenure and added that "we've been relentless against its affiliates."
After citing Panetta's accomplishments, Obama then turned to Hagel, the decorated combat veteran the president picked to take over at the Pentagon. Amid Republican maneuvering, Hagel still hasn't had a nomination vote in the Senate.
A former two-term senator who fell out with his Republican Party over the Iraq war, Hagel faced harsh questioning at his nomination hearing last week from Republicans seeking to portray him as soft on Iran and anti-Israel.
Some Republicans have said they will not vote for Hagel, even though he is expected to win confirmation. Obama again gave Hagel his full-throated support.
"Keeping us prepared will be the mission of my nominee to be the next secretary of defense, a combat veteran with the experience, judgment, and vision that our troops deserve - Chuck Hagel," Obama said.
Hagel would be the first Vietnam veteran to become defense secretary.
'GET A DOG'
Panetta, who is expected to stay in the job until Hagel is confirmed, was often sentimental but also cracked jokes during his farewell speech. With his dog, Bravo, in attendance, he quipped how former U.S. President Harry Truman once remarked that if someone wants a friend in Washington, "get a dog."
"And that's just what I did," laughed Panetta, whose five-decade political career also included being chief of staff to President Bill Clinton.
Panetta quipped that Bravo was in all of the meetings where the United States planned the bin Laden operation, as well as sensitive discussions at the Pentagon.
"And I want you to know that (Bravo) has never told a soul what he heard," Panetta said. "He is definitely not a leaker - at least according to that definition of the word."
Obama used the event to make an appeal for congressional action to come up with a deal to avoid automatic government spending cuts due to take effect on March 1, warning they "could have a severe impact on our military preparedness."
"There is no reason, no reason for that to happen," he said.
The White House also detailed the harsh consequences on ordinary Americans and the U.S. economy.
Panetta, who has made a series parting shots at Congress in recent weeks over its inaction on the looming cuts, sounded a hopeful tone in his speech.
"There's no question that there remain some very significant challenges - the dangers and instability abroad, budget constraints, political gridlock here at home," Panetta said.
"But one thing I have learned is that you cannot be involved in public service and not be optimistic about the future." (Reporting by Phil Stewart and Roberta Rampton; Editing by Eric Beech)