"We should all watch Iranian actions closely in the weeks and months ahead, as they will show the kind of relationship Iran wishes to have with its neighbor," Petraeus told Congress.
But Petraeus also has displayed a keen understanding of the current Iranian government, and many said he would approach Tehran with reserve.
"You will find a very pragmatic general," said Frederick W. Kagan, a scholar at the American Enterprise Institute who has advised the Bush administration on its war strategy. "The Iranians won't be happy because they are not going to be able to feed him nonsense. But he won't be handing anyone in Washington memos saying, 'It's time to go to war.' "
In his new post, Petraeus will have a chance to solve a problem that, before now, he and others could only complain about.
"The question is not if Iran is unhelpful in Iraq," said P.J. Crowley, a retired Air Force colonel and a fellow at the Center for American Progress. "The question is what to do about it."
Once Bush leaves office, his successor is free to change his policies. On Iraq, the president's most important influence will be through the military officers he installs in command.
Although top officers will not set policy themselves, they will be responsible for assessing the war effort and offering the new president their best advice.
Petraeus is unlikely to color the advice he gives the next president, even if the next commander in chief calls for sharp cutbacks in troop levels, said Conrad Crane, director of the U.S. Army Military History Institute.
"He will give his best advice about what he thinks is the right strategy. He won't shape any recommendations based on the political winds. He will make his recommendations based on the reality on the ground," Crane said
But Petraeus will give that advice in private, Crane said, and if it is rejected, he will seek to carry out the new president's policy.
Military officers like Petraeus and Odierno, he said, are used to changes in administrations.
"They serve the commander in chief. There will not be any problems," said William L. Nash, a retired Army major general. "They will give the next president their best advice, argue their case and then salute when given their orders."
Richard J. Danzig, secretary of the Navy under President Clinton and now an advisor to the presidential campaign of Democrat Barack Obama, praised Petraeus but said the next administration should weigh his advice against that of others.