The withdrawal, agreed on two years ago, comes against the backdrop of the U.S. war with Iran that has also sometimes spilled over into Iraq.