Warning followed rocket attacks on Green Zone and Iraqi base housing US troops, after US kills senior Iranian commander.