Having been transferred to the 1st battalion, Stewart served with it in the Walcheren expedition, was left in command of the rear-guard when the army withdrew, and was mentioned in despatches. In September 1810 he went to the Peninsula with the 1st battalion, and commanded it throughout the campaigns of 1811–12. It was engaged at Fuentes de Oñoro, and was soon afterwards attached to Hill's corps, and took part in the actions of Arroyo de Molinos, battle of Almaraz, and Alba de Tormes. In the storming of Fort Napoleon at Almaraz, Stewart led the right wing of his regiment "in a most gallant and spirited manner". The hardships of the retreat to Portugal in the autumn of 1812 broke down his health, and he died at Coria on 11 December, and was buried with military honours in the "campo santo" (cemetery). He was unmarried.