The violence came as Mr. Rumsfeld visited U.S. troops in Mosul and Baghdad .