For Mr Trump, the war has proven politically disastrous, facing opposition from even his Republican base.