Hail to the retiring chief.

Navy Adm. Mike Mullen, the chairman of the Joint Chiefs of Staff, praised Army Gen. David H. Petraeus for his 37 years in uniform, noting the four-star general ranks among the great military leaders in U.S. history.

Mullen recently hosted Petraeus’s retirement ceremony in Virginia. Mullen added that Petraeus set the “gold standard for command in wartime.”

Petraeus is one of the most well-known generals of the wars in Iraq and Afghanistan. He commanded the 101st Airborne Division at the beginning of Operation Iraqi Freedom, the Multinational Security Transition Command-Iraq, Multinational Forces-Iraq, U.S. Central Command and NATO’s International Security Assistance Force in Afghanistan.

Petraeus is retiring from the Army to become the director of the CIA.

“You’ve run the race well, swifter and surer than the rest, and you now stand among the giants not just in our time but of all time, joining the likes of Grant and Pershing and Marshall and Eisenhower as one of the great battle captains of American history,” Mullen said to Petraeus. “You’ve expanded our view of the possible, inspiring our military on to historic achievements during some of the most trying times America has ever known. And today you depart our ranks with the sincere thanks of a grateful nation.”

Petraeus was extraordinarily effective as both a combat leader and a strategist, Deputy Defense Secretary William J. Lynn III said during the ceremony.

The strategies Petraeus employed in two theaters of war were developed quickly to confront new types of foes, Lynn said.

“In Iraq and Afghanistan, our forces fought on battlefields different than we had faced before, different than we had trained for and different than we had equipped for,” the deputy secretary said.

Petraeus was instrumental in developing the counterinsurgency strategy and putting it into practice in Iraq and Afghanistan. That strategy is built “around the adaptability and ingenuity of the 9-11 generation,” Lynn said. “That strategy enabled the world’s most remarkable military to wage a new kind of war.

“Iraq and Afghanistan have tested our men and women in uniform,” the deputy secretary continued. “They have tested the resilience and agility of our institutional military, and they have tested our nation’s resolve. But by acting on his belief that the most powerful weapon and most powerful tool any soldier carries is not his weapon but his mind, General Petraeus has redefined how America fought those wars.”

Petraeus’s strategies and tactics worked, Lynn said, delivering Iraq from the clutches of sectarian violence, and giving the people of Afghanistan a fighting chance.

Petraeus was commissioned after graduating from the U.S. Military Academy at West Point, NY, in 1974. U.S. involvement in Vietnam had essentially ended, and the military was changing as the draft ended and an all-volunteer force came into being.

At his retirement ceremony, Petraeus paid tribute to all those who stuck by the military and steered it through the “hollow force” era. He thanked the noncommissioned officers who stood with him as he went up the ranks. And he thanked his family for the many moves and long separations they have endured.

Petraeus also looked to the future and said the military is entering a difficult period.

“The future requirements include maintaining pressure on al-Qaida, continuing to draw down in Iraq and commencing reductions in Afghanistan — all while sustaining our hard-fought, hard-won, but still-fragile progress in those areas,” he said. “This will be done, of course, against a backdrop of ongoing change in the Middle East and difficult budget decisions here at home.”

All of the decisions leaders make must be made with the people of the force foremost in their minds, he said.

“The essence, the core of our military is and always will be its people: men and women who raise their right hands and recite the oath of enlistment, even though they know that act may result in them deploying to a combat zone where they will be asked once again to put it all on the line, day after day, in crushing heat and numbing cold, under body armor and Kevlar, against resilient, tough, often barbaric enemies; never knowing, as they go outside the wire, whether they’ll be greeted with a hand grenade or a handshake, but being ready and capable of responding appropriately to either,” the general said.