Petraeus made the statement Wednesday in looking back over his 37-year career at a retirement ceremony on the sun-splashed grounds of the Pentagon.

He thanked those he has served with and cautioned the government not to make excessive cuts in the Pentagon budget in coming years. The ceremony was hosted by Navy Adm. Mike Mullen, the top US military officer, who also is leaving active duty. Mullen called Petraeus and his wife, Holly, “national treasures.”

Petraeus will take over as CIA director on Sept. 6.