Pemberton then fought in the United States Army's 1847 actions in Mexico, including the Siege of Vera Cruz in March, the Battle of Cerro Gordo in April, the skirmish near Amazoque in May, the capture of San Antonio and the Battle of Churubusco in August, and most notably in the Battle of Molino del Rey that September. Pemberton was appointed a brevet major for his performance at Molino del Rey on September 8. He then was part of the storming of Chapultepec Castle on September 13, and the Battle for Mexico City that day and the next, where Pemberton was wounded. Pemberton held the position of Aide-de-Camp to Brevet Brigadier General William J. Worth from August 4, 1846, to May 1, 1849 and was a fellow staff lieutenant in the same division as his future opponent in the Civil War, Ulysses S. Grant. He was an original member of the Aztec Club of 1847 - a military society founded by U.S. Army officers who served in Mexico City during the military occupation following the war.