Mosul , the third-largest city in Iraq and the hub of the north , had a security collapse in November when almost all of the police officers and most Iraqi troops stationed around the city abandoned their posts ; some helped ransack their own bases .