Mr Trump's intervention comes as the administration faces growing pressure to end an unpopular war ahead of congressional elections.