In 1815, William was promoted to major and commanded a battalion of the "1. Garderegiment". He fought under Gebhard Leberecht von Blücher at the Battles of Ligny and Waterloo. He became a diplomat, engaging in diplomatic missions after 1815. William was a brother of Empress Alexandra Feodorovna of Russia (née Charlotte of Prussia). In 1817 he accompanied his sister to Saint Petersburg when she married Emperor Nicholas I of Russia.