The story opens with Aksenty Ivanovich Poprishchin writing in his diary about an adventure that has just taken place. He is very late to work (did we mention it's a soul-crushing job?). On the way to the office he sees his director's daughter getting out of a carriage and going into a clothing store. Poprishchin is instantly infatuated. But he's embarrassed to be seen wearing his ratty overcoat, so he hides.
Poprishchin hears a little voice, and realizes that the daughter's dog, Medji, and another dog, Fidele, are talking. He reasons that such things can happen; after all, he's read reports of talking fish and cows. But when the dogs start talking about writing each other letters, this stops him cold. At this point, Poprishchin admits he sometimes hears or sees things others don't, but he still seems to be able to have some rational thoughts.
Poprishchin writes in his diary about how much he hates the various people at work.
He also writes about his daily routines, which go something like this: show up early or late to work, sharpen the director's pens, push some paper, leave sometime in the afternoon, go do something "cultured" like copying poetry or seeing a variety show, maybe stalk the director's daughter in her apartment, or go home and lie in bed in the dark obsessing about all of the above.
This routine starts to break down when he decides to get his hands on the dogs' letters. He goes to the building where Fidele's owner lives, demanding to speak with her dog. He can't imagine why she's alarmed or why the dog refuses to talk to him. He pushes his way into the apartment, grabs a bunch of letters in the dog's basket, and leaves. The dog still has nothing to say—she bites Poprishchin in the leg.
He starts reading the dogs' letters, hoping to find out more things about his director's social world and political involvements. He especially wants to get the inside scoop about the director's daughter. The dogs have a lot to say about all that. They write that the director is a boring guy but that he just received a ceremonial ribbon (probably from the emperor) and is feeling pretty good about himself. But the real news is that the daughter has fallen madly in love and is going to marry a kammerjunker, a hilarious word and a low-ranking member of the emperor's court. Poprishchin is shocked. He can't imagine what a kammerjunker has that he doesn't have (um, a title, money, good looks?). This guy can't be anything special; what can she possibly see in him?
Poprishchin reads in the newspapers that Spain is now without a king because of some trouble finding an heir. He can't stop obsessing about it. Suddenly, it all makes sense: he, Poprishchin, is not just a government clerk—he is actually the king of Spain, Ferdinand VIII! He makes himself a royal robe by cutting up his government uniform, and waits for the Spanish delegation to arrive to escort him to the Spanish court. He reveals his royal identity to his housekeeper, who of course is freaked out at the sight of him in his not-quite-ready-for-Project-Runway king's get-up.
Some time later, he says he has arrived in Spain, which, he tells us, is really the same country as China. Spain has strange customs: everyone's head is shaved; people constantly beat him with sticks and drip cold water on his head. He thinks he has fallen into the hands of the Grand Inquisitor. It sounds to us like he is not in Spain (or China for that matter), but actually in an insane asylum. The diary ends with a couple of jumbled entries and a desperate, hallucinating Poprishchin pleading with his mother to come save him.