Karl W. Eikenberry spent half of America’s decade at war serving in Afghanistan. Three tours — two as a general, one as ambassador — ended last week without brass bands or fanfare as Eikenberry took his seat next to his wife, Ching, on a Safi Airways commercial flight bound for Dubai.

With his departure, the United States loses a diplomat with varied experience in Afghanistan and a prominent voice of skepticism about the nation’s deepening involvement in the war. While his tenure was hampered by moments of tension with the U.S. military and trouble with President Hamid Karzai, his early warnings that the Afghan government’s failings could jeopardize the mission have proved more prescient over time.

“When it comes to your reporting and your analysis, you’ve got to call it like you see it,” Eikenberry said in an interview, recalling his message to his staff: “Don’t feel under pressure to always say the glass is half-full when it might be near empty.”

Veteran diplomat Ryan C. Crocker takes over as the new ambassador Monday — Marine Gen. John Allen assumed the military command recently from Army Gen. David H. Petraeus — and the two inherit Afghan partners who are wary and scarred by numerous policy battles with the United States. There is a sense of cautious optimism among Karzai’s aides that a fresh chapter could begin.

“We had massive disagreements,” recalled Shaida Mohammad Abdali, the deputy national security adviser and a close aide to Karzai. “We hope this new team will bring a change in the approach of the United States towards Afghanistan.”

The Afghan government’s halting steps to build institutions, fight corruption, deliver services and satisfy its people remained one of Eikenberry’s chief concerns as he left his post and headed to Stanford University. Without reform, and with fewer American troops and money to provide security and catalyze the economy, he worried the government could lose the grip on local factions and militias that have a history of brutal civil war.

“There has to be more commitment to institution-building of the state, there has to be more commitment to accountability of the government,” Eikenberry said. “It requires more political will at the center than we currently have. It alienates the people.”

The ability of Taliban leaders to operate safely from Pakistan also puts at risk the Obama administration’s plan for transition to Afghan control, he said. Without change in Pakistan, the Taliban will remain strong and replenish its ranks, and peace talks “may not look as appealing to them if they know they have sanctuary.”

Within the embassy, Eikenberry is admired as a penetrating strategic thinker with a sincere affection for Afghans and an earnest desire to help their country. He has visited all 34 provinces. He’s escaped mortar rounds in Nurestan, rockets in Wardak, and a rocket-propelled grenade that landed 50 yards away during last year’s peace conference in Kabul. His long tenure and travels have made him widely known among Afghans, who eagerly greet him on the street.

He has been a relentless questioner, probing everyone from governors to their servants about the war — while being careful to avoid sending small signals that the United States was dictating to the Afghans.

Last week, he stopped to query a hamburger vendor in a popular Kabul garden. The vendor explained that his country is wracked by war and poverty and ruled by a worthless government that “calls Pakistan our friend and the Taliban our brothers.” With such a foundation, he said, any building would crumble.

“You get very consistent answers when you get around the country,” Eikenberry said as he walked away. “Very consistent.”

Leaked assessment

The North Carolina native and West Point graduate spent the bulk of his military career focused on China and East Asia before the attacks of Sept. 11, 2001, which took the lives of people just two offices away from his in the Pentagon. He was sent to Afghanistan in 2002 to oversee the formation of the post-Taliban Afghan army, and returned for a second tour as the top U.S. military commander.

By the time Eikenberry had retired as a three-star general and returned as U.S. ambassador in April 2009, the Taliban had resurged to an alarming degree. During the Obama administration’s debate over sending tens of thousands of additional U.S. troops, Eikenberry warned in cables that a costly troop buildup would make the Afghan government more dependent on the United States and that Karzai was “not an adequate strategic partner.”

His leaked assessment upset Army Gen. Stanley A. McChrystal, who felt blindsided by the sentiments, according to his aides. After McChrystal was fired, repairing the civilian-military rift became paramount. Eikenberry said his reorganization of the staff gave civilians a more prominent voice in decision-making. Other civilian colleagues said they believed Eikenberry’s desire for a close collaboration with the military made the embassy too accommodating to their demands.

As the leader of a civilian mission that more than tripled during his tenure, growing to more than 1,200 people, he supported the strategy chosen by President Obama and believed the troops would improve security where they were deployed. But in meetings Eikenberry was clear about his “skepticism about both the capacity and motivation of our partners,” said one U.S. official who worked in Kabul. “I think it’s not always in the military’s DNA to admit publicly how real the risks of failure are in a situation like this. But Eikenberry’s very blunt and very honest.”

Eikenberry’s critics, including some U.S. military officials, contend the embassy did not move quickly or decisively enough to support the military’s security gains with development and governance assistance at the local level. The dismantling of Taliban strongholds, particularly in southern Afghanistan, these critics say, has progressed far enough that now the civilian effort can take more precedence. “His skepticism, I think, is proven wrong,” said a senior Western official. “Afghanistan is not the same place it was in 2009.”

‘A moral obligation’

Many of the same problems remain. One of Eikenberry’s toughest was Karzai. Even more than the cables, the fraught 2009 presidential election — Karzai accused the United States of trying to make him lose — inflicted wounds that did not heal and weakened Eikenberry’s influence, according to U.S. and Afghan officials.

During battles over the fate of private security companies, corruption scandals such as Kabul Bank, and Karzai’s calls to end NATO night raids and airstrikes, the United States often chose to avoid public confrontation with Karzai for fear of worsening the situation. A rare exception came recently, from Eikenberry. After Karzai made a speech in which he likened U.S. troops to an occupying army, having previously ordered all airstrikes on Afghan homes to cease, Eikenberry delivered an impassioned response at Herat University.

“At the point your leaders believe that we are doing more harm than good, when we reach a point that we feel our soldiers and civilians are being asked to sacrifice without a just cause, and our generous aid programs dismissed as totally ineffective and the source of all corruption,” Eikenberry said, “the American people will ask for our forces to come home.”

It was a rare public rebuke from an American official — one borne of his experience as both a soldier and a civilian. At some point, he later said, “I have a moral obligation to speak out.”