The attack came just hours after outgoing US ambassador Zalmay Khalilzad gave a farewell news conference following a 21-month posting to Baghdad.