Colonel Samuel Whitehurst had been consumed with work in the last days of his brigade's nine-month stint in eastern Afghanistan when alarming news about his former battleground in northern Iraq began to reach him.
Whitehurst fired off an e-mail to the mayor of the Iraqi city of Samarra, who had become a close friend, saying he was thinking of him.
Days after a band of Islamic militants took over Mosul and several towns in the north in early June, he got terrible news: Colonel Gayath Sami, the Iraqi officer Whitehurst had groomed to run Samarra's security command centre, had been slain in the fighting.
"To find out that he had been killed," said Whitehurst, who commands the 3rd Brigade Combat Team of the 10th Mountain Division, deployed in Paktia province. "Those are the things I worry about - the friends I met there and what's going to happen to them."
The catastrophic turn Iraq has taken in recent weeks has startled US veterans who spent years seeking to set up the country, and particularly its security forces, for success. The Iraq war killed nearly 4,500 US troops and, by some estimates, cost taxpayers more than US$2 trillion.
The country's violent downward spiral as Islamist militants seized large swathes of territory has been particularly unsettling to those who are currently in Afghanistan at the tail end of America's longest war and hoping for a better outcome.
"Watching how much everybody worked to continue to have hope and progress for that country and to watch it crumble is fairly disheartening," said Lieutenant General Joseph Anderson, who spent 31/2 months in Iraq and is now tactical commander of US and allied troops in Afghanistan.
"It's very personal when you get letters and e-mails from all the people you know there who used to work for you saying: 'Can you get my family out of there, everything is collapsing.' "
Some American soldiers in Afghanistan said the aftermath of the US pullout in Iraq shouldn't be seen as a failed military campaign but rather a case study of the limitations of what the armed forces can accomplish.
"Personally, I don't feel anything I endured in Iraq was in vain," said Captain Rick McCuan, 31, an intelligence analyst with the 82nd Airborne Division who is deployed in southern Afghanistan. "We were charged with a mission, and we executed that mission to set the conditions for the Iraqi people to take control of their own destiny."
Others can't help but feel a degree of bitterness. Staff Sergeant Kenneth Ventrice, 34, served three tours in Iraq and is on his second in Afghanistan.
"It affected me personally because I was in Fallujah," he said. "The blood, sweat and tears we spent trying to make that place better."