President Donald Trump said American forces were no longer needed in Syria and declared victory over the Islamic state.