In 1846, Shields left for war with two brigades under his command. In February 1847, when Tampico was abandoned, his men assumed control of the city. He commanded the 3rd Brigade, Volunteer Division, at the battles of Vera Cruz and Cerro Gordo, where he was severely wounded by grapeshot, and spent nine weeks recuperating. He returned to fight in a single day, at both the battles of Contreras and Churubusco. His command that day was criticized as clumsy by some, and praised as skillful by others. He required reinforcements to overcome strong enemy resistance, but his brigade took over 800 prisoners.