When William Ewart Gladstone acceded to power in 1868, Baring was again appointed Under-Secretary of State for War, and this office he held until February 1872, when he was appointed Viceroy of India. In January 1876, however, he resigned. He had recommended the conclusion of arrangements with Sher Ali Khan which, as has since been admitted, would have prevented the Second Afghan War; but his policy was overruled by the Duke of Argyll, then Secretary of State for India. in 1876 he was created Viscount Baring, of Lee in the County of Kent, and Earl of Northbrook, in the County of Southampton.