Washington (CNN) -- With full military fanfare -- gun salutes, fife and drum corps, brass bands, a flyover and presidential praise -- the nation bid farewell to its top military man and honored his successor Friday.
Adm. Mike Mullen has been Joint Chiefs of Staff chairman, the president's top military adviser, since October of 2007.
Army Gen. Marty Dempsey takes his place.
"As the new secretary of defense, I am confident of the future because we have the strongest military force in our history -- and it is strong because we can replace one great warrior with another," Leon Panetta said during the 90-minute Hail and Farwell ceremony on the Fort Myer parade ground across the river from Washington..
It wasn't just the October sun that brightened the day for Mullen. It was also the lengthy praise from the president and from the military he had served for 43 years, as well as the day's latest success in the terrorism fight -- the successful take-down of al Qaeda leader Anwar al-Awlaki.
Obama pointed to Mullen's leadership, from all the advice he provided in the Oval Office about the nation's two wars, to his crucial testimony to Congress that the country should end its ban on gays and lesbians serving open in the military. "Mike, as you look back at your four consequential years as chairman and your four decades in uniform, be assured: Our military is stronger and our nation is more secure because of the service that you have rendered."
Mullen, the son of a Hollywood publicist, is a master of self-deprecating humor. He drew laughter from the crowd when he told a story of how he had been mistakenly identified at a party as the former general, and now CIA director, David Petraeus. And he said that White House meetings went better if participants didn't criticize the president's baseball team, the Chicago White Sox.
"And he really likes it when you laugh at his jokes. It just makes the meeting go better." Mullen said.
Mullen never misses a chance to make a point, hammering a favorite theme, that the American public must become more connected to its military personnel when they come home, giving them a chance, a job, an education.
"Welcome them back to those places, not with bands and bunting or yellow ribbons, but with the solemn recognition that they have done your bidding, they have represented you well, they have carried the best of you and of this country into battle," Mullen said. "They have done things and seen things and bear things in their souls that you cannot know."
Panetta praised Mullen's hard work and dogged persistence. "His leadership, his influence, his honest candor, his compassion and his outspoken concern for our troops have set an exceptionally high standard for the responsibilities and performance of a chairman of the Joint Chiefs," Panetta said.
Dempsey becomes Panetta's and Obama's right hand man in navigating the withdrawal from Afghanistan and the hard choices about budget cuts.
"Marty's strategic vision is the right one for this time of transition as we craft a joint force that can defeat the wide range of complex security threats we face today, and into the future," Panetta said. "In a speech he gave while leading the Army's Training and Doctrine Command, Marty said that the pace of change in today's world requires that we look at the future differently than we have in the past. Instead of trying to leap ahead decades into the future as we design our military, we must build a force able to handle the challenges we know it will face today, and one that can adapt to the future."
Mullen oversaw two wars plus the U.S. role in the Libyan conflict during his four-year term. But in recent weeks he found himself in a final skirmish inside the Obama administration itself over his statements that the extremist Haqqani network along the Afghanistan border was "a veritable arm" of the Pakistani intelligence service.
He chose not to comment directly on that, saying only that in his advice to his successor, "I urged Marty to remember the importance of Pakistan to all of this, to try and do a better job than I did with that vexing and yet vital relationship."
Mullen said Afghanistan will be Dempsey's biggest challenge. "In seeing this critical transition through to its completion, in making sure that the security gains we have made are not squandered by the scourge of corruption or the lack of good governance that still plagues the country, our strategy is the right one," Mullen said. "We must keep executing it."
The new chairman, the first Army general elevated to chairman since 2001, had the last word. "Although you're a sailor and I'm a soldier, in the tradition of the horse cavalry, I want you to know that I will be proud to tell people that I rode with Mike Mullen during some of the most challenging times in our nation's history."