On 29 March 1810 he exchanged into the 95th Rifles and with the glories of that distinguished regiment his name was henceforth linked. He was appointed to the command of the 3rd battalion, which had lately been raised, and on 11 July 1810 he embarked with the headquarters and two companies in the frigate , and landed on the 29th at Cadiz, which was then besieged by Marshal Victor. He commanded his battalion at the Battle of Barrosa, where he was wounded twice, once severely; was present at the sieges of Ciudad Rodrigo and Badajoz (1812), and at the battles of Salamanca and Vittoria. Soon after the capture of Badajoz he was transferred to the 1st battalion. He obtained the rank of colonel on 4 June 1813; was at the storming of San Sebastián, at the passage of the Nivelle, where he was again severely wounded – shot through the lung – and at the battles of Orthez and Toulouse. In July 1813 we find him a Knight Commander of the Bath. On 16 February 1814 Sir Andrew Barnard was appointed to the command of the 2nd brigade (the 52nd and 1st Battalion 95th) of the celebrated light division. For his services in Spain and Portugal he received a gold cross and four clasps.