He entered the army in 1805 as an ensign in the Scots Fusilier Guards, now known as the Scots Guards. He accompanied the regiment when it was posted to the Peninsular and was present at the passage of the Douro, the capture of Oporto and the pursuit of General Soult's army. He was later present at the Battle of Talavera in July 1809, where he was wounded through the body. Left behind in hospital when the army retreated, he was made prisoner by the enemy.