The childhood of the hero took place in the small town of Prince-Vienna of the South-Western Territory. Vasya - that was the name of the boy - was the son of a city judge. The child grew up “like a wild tree in the field”: the mother died when her son was only six years old, and the father, absorbed in his grief, paid little attention to the boy. Vasya wandered around the city for days, and pictures of city life left a deep imprint in his soul.
The city was surrounded by ponds. In the middle of one of them on the island stood an old castle, which once belonged to the count family. There were legends that the island was strewn with captured Turks, and the castle stands "on human bones." The owners long ago left this gloomy dwelling, and it was gradually being destroyed. Its inhabitants were urban beggars who had no other refuge. But among the poor there was a split. Old Janusz, one of the former count servants, received a certain right to decide who can live in the castle and who cannot. He left there only "aristocrats": Catholics and the former count of servants. The exiles found refuge in a dungeon under an ancient crypt at an abandoned Uniate chapel on a mountain. However, no one knew their whereabouts.
When meeting with Vasya, Old Janusz invites him to go to the castle, for there is now a "decent society." But the boy prefers the "bad society" of the exiles from the castle: Vasya pity them.
Many members of the "bad society" are well known in the city. This is a half-mad elderly “professor” who always mutters quietly and sadly; the fierce and pugnacious bayonet-junker Zausailov; a drunken retired official Lavrovsky, telling everyone incredible tragic stories about his life. And calling himself General Turkevich is famous for “convicting” the venerable citizens (police, secretary of the county court and others) right under their windows. He does this in order to get vodka, and reaches his goal: the "convicted" are in a hurry to pay off him.
The leader of the entire community of “dark personalities” is Tyburtius Drab. Its origin and past are not known to anyone. Others suggest an aristocrat in him, but his appearance is simple-minded. He is known for extraordinary scholarship. At fairs, Tyburtius entertains the audience with lengthy speeches from ancient authors. He is considered a sorcerer.
Once Vasya with three friends comes to the old chapel: he wants to look there. Friends help Vasya get inside through a high window. But when they saw that there was someone else in the chapel, the friends ran away in horror, leaving Vasya to their fate. It turns out that there are children of Tyburtia: nine-year-old Valek and four-year-old Marusya. Vasya often begins to come to the mountain to his new friends, to carry them apples from his garden. But he walks only when Tyburtius cannot catch him. Vasya does not tell anyone about this meeting. To frightened friends he says that he saw devils.
Vasya has a sister, four-year-old Sonya. She, like her brother, is a fun and playful child. Brother and sister love each other very much, but Sonina the nanny impedes their noisy games: she considers Vasya to be a bad, spoiled boy. The father holds the same view. He does not find in his soul a place for love for the boy. Father loves Sonya more, because she looks like her late mother.
Once in a conversation, Valek and Maroussia tell Vasya that Tyburtius loves them very much. Vasya speaks of his father with resentment. But he suddenly learns from Valek that the judge is a very fair and honest person. Valek is a very serious and smart boy. Maroussia is not at all like the frisky Sonya, she is weak, thoughtful, “unhappy”. Valek says that "the gray stone sucked life out of it."
Vasya learns that Valek is stealing food for his hungry sister. This discovery makes a heavy impression on Vasya, but nevertheless he does not condemn his friend.
Valek shows Vasya the dungeon where all members of the "bad society" live. In the absence of adults, Vasya comes there, plays with his friends. During a blindfold game, Tyburtium unexpectedly appears. The children are scared - because they are friends without the knowledge of the formidable head of the "bad society." But Tyburtius allows Vasya to come, taking from him a promise not to tell anyone where they all live. Tyburtium brings food, cooks dinner - according to him, Vasya understands that the food is stolen. This, of course, confuses the boy, but he sees that Maroussia is so glad to eat ... Now Vasya comes up the mountain unhindered, and adult members of the "bad society" also get used to the boy, love him.
Autumn comes, and Maroussia falls ill. In order to somehow amuse the sick girl, Vasya decides to ask Sonya for a while a large beautiful doll, a gift from her deceased mother. Sonya agrees. Maroussia is delighted with the doll, and she even feels better.
Old Janusz comes to the judge several times with denunciations of members of the "bad society." He says that Vasya is talking with them. The nanny notices the absence of the doll. Vasya is not allowed out of the house, and after a few days he runs away secretly.
Marusa is getting worse. The inhabitants of the dungeon decide that the doll must be returned, and the girl will not notice it. But seeing that they want to pick up the doll, Marusya weeps bitterly ... Vasya leaves her the doll.
And again Vasya is not allowed out of the house. The father is trying to get his son to confess where he went and where the doll went. Vasya admits that he took the doll, but no longer says anything. The father is angry ... And at the most critical moment, Tyburtius appears. He is carrying a doll.
Tyburtius tells the judge about Vasya’s friendship with his children. He is amazed. Father feels guilty before Vasya. It was as if a wall had collapsed, separating father and son for a long time, and they felt themselves to be close people. Tyburtius says that Maroussia is dead. Father lets Vasya say goodbye to her, while he passes through Vasya money for Tyburtia and a warning: it is better for the head of the "bad society" to hide from the city.
Soon, almost all “dark personalities” disappear somewhere. All that remains is the old "professor" and Turkevich, to whom the judge sometimes gives work. Maroussia is buried in an old cemetery near a crumbling chapel. Vasya and her sister look after her grave. Sometimes they come to the cemetery with their father. When the time comes for Vasya and Sonya to leave their hometown, they make their vows over this grave.