As an officer with Major General Zachary Taylor's forces, Maclay was wounded at the Battle of Resaca de la Palma, Texas on May 9, 1846, at the start of the Mexican–American War. To help him recuperate, Maclay was sent home on recruiting duty. He returned to the army in time to participate in garrison duty defending Puebla, Puebla which the U.S. Army occupied in 1847 and left at the end of the war in 1848.