Cesarius-Benjaminus Cui was born in Wilno, Vilna Governorate of the Russian Empire (now Vilnius, Lithuania) into a Roman Catholic family of French and Polish–Lithuanian descent, the youngest of five children. The original French spelling of his surname was "Queuille". His French father, Antoine (Anton Leonardovich) Cui, entered Russia with Napoleon's army; in 1812 he was injured during the battle near Smolensk and following the defeat he settled in Vilnius. He married a local noble woman Julia Gucewicz. Some sources indicate that her father was the famous Lithuanian architect Laurynas Gucevičius.