Alexey Konstantinovich Tolstoy was born in Saint Petersburg to the famed family of Tolstoy. His father, Count Konstantin Petrovich Tolstoy (1780–1870), a son of the army general, was a Russian state assignation bank councilor. His mother, Anna Alekseyevna Perovskaya (1796–1857), was an illegitimate daughter of Count Aleksey Kirillovich Razumovsky (1784–1822), an heir of the legendary Ukrainian hetman Alexey Razumovsky. A. K. Tolstoy's uncle (on his father's side) was Fyodor Tolstoy (1783–1873). His uncle on his mother's side was Aleksey Perovsky (1787–1836), an author known under the pen name of Antony Pogorelsky. Aleksey Konstantinovich was a second cousin of Leo Tolstoy; Count Pyotr Andreyevich Tolstoy was their common great-grandfather.