After his education at Wahlstatt (now Legnickie Pole) and Berlin cadet schools, he was commissioned a lieutenant in 1866. He fought in the Austro-Prussian War (1866) and the Franco-Prussian War (1870–1871). Hindenburg was selected for prestigious duties: serving the widow of King Frederick William IV of Prussia, being present – as one of a group of young officers decorated for bravery in battle, who had been chosen to represent their regiments – in the Palace of Versailles when the German Empire was proclaimed on 18 January 1871, and as Honour Guard prior to the Military funeral of Emperor William I in 1888. He was promoted to captain in 1878, major in 1881, lieutenant-colonel in 1891, colonel in 1893, major-general (brigadier general) in 1897 and lieutenant general (major-general) in 1900. Hindenburg remained in the army, eventually commanding a corps and being promoted to General of the Infantry (equivalent to a British or US lieutenant-general; the German equivalent to four-star rank was Colonel-General) in 1903. Meanwhile, he married Gertrud von Sperling (1860–1921), also an aristocrat, by whom he had two daughters, Irmengard Pauline (1880) and Annemaria (1891) and one son, Oskar (1883).