Cesarius-Benjaminus (Цезарий-Вениамин) Cui was born in Vilnius, Vilna Governorate, Russian Empire (now Vilnius, Lithuania), to a Roman Catholic family, the youngest of five children. His French father, Antoine (his name was later Russified as Anton Leonardovich), had entered Russia as a member of Napoleon's army in 1812, settled in Vilnius upon their defeat, and married a local woman named Julia Gucewicz. The young César grew up learning French, Russian, Polish, and Lithuanian. Before finishing gymnasium, in 1850 Cui was sent to Saint Petersburg to prepare to enter the Chief Engineering School, which he did the next year at age 16. In 1855 he was graduated from the Academy, and after advanced studies at the Nikolaevsky Engineering Academy, now Military engineering-technical university, he began his military career in 1857 as an instructor in fortifications. His students over the decades included several members of the Imperial family, most notably Nicholas II. Cui eventually ended up teaching at three of the military academies in Saint Petersburg. Cui's study of fortifications gained from frontline assignment during the Russo-Turkish War of 1877-1878 proved quite important for his career. As an expert on military fortifications, Cui eventually attained the academic status of professor in 1880 and the military rank of general in 1906. His writings on fortifications included textbooks that were widely used, in several successive editions (see bibliography below).