Reaching the outskirts of Mexico City, the 5th was part of the flanking movement that led to the victory at Contreras on 19 August. The following day, they took the right flank in the assault on the bridgehead at Churubusco. The 5th provided storming parties for the assaults on the Molino del Rey on 8 September and Chapultepec Castle on the 13th; the full regiment followed up in the latter seizure. Later on the 13th, the 5th joined in the seizure of the Garita San Cosme, one of the city gates of Mexico City itself. This led to the city's surrender on the 14th.