Iran would consider cooperating with the United States in fighting Sunni extremist fighters in Iraq if Washington acts against them, President Hassan Rouhani said Saturday.