An Iraqi security official told AFP the attack was carried out against an American base in Tarmiyah, 30 kilometres (19 miles) north of the capital.