In American history he is remembered as the senior ranking officer of the Royal Marines to serve on the British North America and West Indies Station during the War of 1812.
On 6 July 1782, while serving aboard HMS Sultan, Williams was wounded in the naval Battle of Negapatam (1782)between British and French fleets off the southeastern coast of India.
[6] In spite of this unattached status on half-pay, the young lieutenant remained abroad on foreign service until 27 May 1785.
During the French Revolutionary wars, Williams served aboard HMS Arethusa in the Channel Squadron commanded by Commodore Sir John Borlase Warren, 1st Baronet, and participated in the naval Action of 23 April 1794 near Guernsey in which the squadron captured three French warships.
Still captain of the Marines aboard HMS Robust, Williams took part in the Battle of Tory Island on 12 October 1798.
[9] When the Royal Marine Artillery was formed on 1 September 1804, he was chosen to be the officer commanding, a role that he initially carried out until 1810, and again accomplished from 1816 until 1827.
As an experienced and competent major with a thorough knowledge of artillery, he was appointed to set up, and command, a standing battalion of Royal Marines for foreign service.
Upon returning from Spain, Williams was appointed a brevet lieutenant colonel, to avoid any subsequent issues with seniority when dealing with army field officers.
Williams had planned to lead an expedition into Georgia in the spring of 1815, but the war had ended, and he returned to the UK.
In April 1838 he was appointed to be a commissioner for inquiring into the several modes of promotion, along with several other retired senior officers, including the Duke of Wellington.