BAGHDAD, Iraq (CNN) -- Gen. David Petraeus praises U.S. troops in Iraq as having achieved "the stuff of history" in a letter bidding them farewell as he leaves his post as the top American commander there.
Gen. David Petraeus is being promoted to head of U.S. Central Command, which operates in the Middle East.
"Your great work, sacrifice, courage, and skill have helped to reverse a downward spiral toward civil war and to wrest the initiative from the enemies of the new Iraq," Petraeus writes in a letter dated September 15 -- Monday -- and posted on the Web site of the Multi-National Force in Iraq.
"You have not just secured the Iraqi people, you have served them, as well," Petraeus writes, praising his forces as "builders and diplomats as well as guardians and warriors."
"Although our tasks in Iraq are far from complete and hard work and tough fights lie ahead, you have helped bring about remarkable achievements," he writes, adding a handwritten "Thank you!" at the bottom of the letter.
Petraeus took command in Iraq early in 2007, when rampant violence left many doubting that stability could ever be restored. The author of the current U.S. counterinsurgency doctrine, Petraeus used a "surge" of 30,000 additional American troops into the country to try to pacify areas and "hold" them afterward, rather than letting them slide back into lawlessness.
Experts give Petraeus and the surge some of the credit for the decline in violence there on his watch, along with the decision by radical Shiite cleric Muqtada al-Sadr to order his followers to cease fire and that of many Sunni insurgents to switch sides and fight on the U.S. side -- for pay -- rather than against the Americans.
Petraeus is being promoted to head of U.S. Central Command, which operates in the Middle East. His former deputy, Gen. Ray Odierno, will take command in Iraq.