WASHINGTON — Ryan Crocker, the unflappable diplomat who became the civilian face of America’s wars in Iraq and Afghanistan over two administrations, is stepping down as ambassador to Afghanistan and retiring from the U.S. foreign service after a storied tenure in some of the world’s most dangerous hotspots.

State Department spokeswoman Victoria Nuland said Tuesday that Crocker would leave Kabul this summer because of health reasons she declined to detail. His departure came a year earlier than planned after Crocker, 62, came out of retirement in 2011 to take the helm of the embassy at President Barack Obama’s personal request.

His resignation was announced as the U.S. and its NATO allies forged ahead with plans to close the largely stalemated conflict by the end of 2014 but keep their troops fighting there in the meantime.

With that timetable on track, Crocker’s departure from Kabul will not likely herald any new U.S. approach to the conflict.

However, the loss of his presence as a trouble-shooter since the 1980s will be felt as the administration struggles to prevent Afghanistan from descending again into the cauldron of extremism that gave sanctuary to Osama bin Laden and leaders of his al-Qaida network.

Crocker’s departure comes at a time when the NATO and U.S. civilian efforts in Afghanistan face increasing strain while the military draws down its forces in time for the 2014 end of combat operations.

The U.S. embassy in Kabul confirmed Crocker’s departure “with regret,” while officials in Washington said he made his plans known to Obama during this weekend’s NATO summit in Chicago at which the allies discussed the way forward in Afghanistan.

In Afghanistan for his second tour as America’s top U.S. envoy in Kabul — he reopened the U.S. embassy there in 2002 after the ouster of the Taliban regime — Crocker was called on to lead a ramp-up in civilian operations similar to one he supervised in Iraq.

In nominating Crocker for the Kabul post, Obama hailed him as “one of our nation’s most respected diplomats,” who “is no stranger to tough assignments.”

Indeed, Crocker was a six-time ambassador, running embassies not only in Iraq and Afghanistan but also in Pakistan, Kuwait, Lebanon and Syria. An Arabic speaker, he held diplomatic posts in Qatar, Iran, Egypt and Lebanon earlier in his career.

As a young officer he was in Beirut when the U.S. Embassy there was blown up in 1983. His residence in Syria was ransacked by a mob when he was ambassador there in 1998.

Such experiences contributed to Crocker’s calm under fire. When a Pakistan-based group allied with the Taliban staged a spectacular attack on the U.S. Embassy in Kabul last September, taking over a nearby building and firing rockets and bullets at the compound during a 20-hour siege, Crocker was unfazed.

“This really is not a very big deal,” he said at the time. “If that’s the best they can do, you know, I think it’s actually a statement of their weakness.”

It is not known who will replace him, although officials said the most likely candidate is James Cunningham, a former ambassador to Israel and deputy U.N. envoy who is now one of the ex-ambassadors serving under Crocker in Kabul.

“Ambassador Crocker’s tenure has been marked by enormous achievements,”Nuland said, listing the successful negotiation of a strategic partnership agreement with Afghanistan and the Chicago summit as highlights.