American troops and warplanes repelled an insurgent attack Wednesday in the northern Iraqi city of Mosul , killing at least 25 attackers .