In December 1849, Williams was promoted from Gentleman Cadet to second lieutenant in the Royal Artillery. Further promotions followed: lieutenant in 1851, second captain (1856), captain (1863), and major (1872). In 1875, he was made a lieutenant colonel and six years later a colonel. During his career, he saw active service in the Crimean War and in central Asia, and was mentioned in despatches during the Indian Mutiny. In 1883, he was appointed a Colonel on the Staff in command of the Royal Artillery at Aldershot, in the place of Colonel William Reilly; two years later, he was appointed an Extra Aide-de-camp to the Duke of Cambridge, and then three years after that he was made major general on the staff commanding troops at Woolwich. In 1892, Williams was made Deputy Adjutant General at the Artillery Headquarters; in 1894, he was placed on retired pay and made an Extra Equerry to the Duke of Cambridge. He remained in the Duke's service, eventually as an equerry, until the Duke's death in 1904, when Edward VII appointed him a Knight Commander of the Royal Victorian Order. The following year, he became Colonel Commandant of the Royal Horse Artillery.