His move defuses a political crisis that shook faith in his wartime leadership and worried Western partners.