Murray fought with the Cavalry in the Corunna campaign of 1808–09 during the Peninsular War, serving under Lord Paget (who later became the Marquis of Anglesey); he was present at the Battle of Sahagún in December 1808. In 1810, he exchanged his commission and transferred to the 52nd Foot; he then travelled to Cádiz on Lord Lynedoch's staff. Murray was promoted to Major in the 103rd Foot in April 1810 and appointed Assistant Adjutant-General in Spain and Portugal. He was present during the Siege of Cádiz.