In the course of the siege of that fortress by the combined forces of France and Spain, he was severely wounded.
He returned home with his regiment in 1783, and accepted a cadetship in the Bengal artillery, though he did not long remain in India.
Subsequently, he retired from the service; but in the war occasioned by the French revolution, he volunteered as a captain in the North Hampshire militia.
He died at Eastbourne, Sussex, on 4 September 1815, and was buried on the 14th in the churchyard of West Molesey, Surrey, to which parish he had been a liberal benefactor.
His only daughter and sole heiress, Emma Mary, became the wife of W. A. Mackinnon, of Newtown Park, M.P.