He was promoted to major on 17 January 1829 and lieutenant-colonel on 2 April 1834, and commanded his regiment throughout the First Anglo-Afghan War, during which he made his reputation. His regiment was one of those which, under Sir Claude Martin Wade, forced the Khyber Pass, and co-operated with Sir John Keane's army from Bombay in the storming of Ghazni and the capture of Kabul in 1839. For his services during the campaign he received a medal, was made a Companion of the Order of the Bath, and selected by Shah Shujah as one of the officers to receive his newly formed Order of the Dooranee Empire.