How delightful that in an era as crude as ours this finely composed new novel by Amor Towles stretches out with old-World elegance. “A Gentleman in Moscow” offers a chance to sink back into a lost attitude of aristocracy — equal parts urbane and humane — just what we might expect from the author of that 2011 bestseller “Rules of Civility.” But if Towles’s story is an escape we crave, it is also, ironically, a story of imprisonment.

( Viking )

The book opens a few years after the Russian Revolution in a period of violent upheaval. A handsome count named Alexander Rostov has been summoned before the Emergency Committee of the People’s Commissariat for Internal Affairs and accused of writing a counter-revolutionary poem. The trial transcript offers an indication of the count’s blithe resistance to the spirit of the times. Imagine a younger, Slavic version of Alexander McCall Smith facing the Bolsheviks. Asked to state his occupation, he replies, “It is not the business of a gentleman to have occupations.” Only high-ranking friends keep him from being thrown against a wall and shot. Instead, he’s declared a “Former Person” and sentenced to life imprisonment in Moscow’s Hotel Metropol.

Towles observes that “the Russians were the first people to master the notion of sending a man into exile at home.” But the count’s sentence is hardly the Gulag. After all, the Hotel Metropol is a grand Art Nouveau palace — an actual place, still standing. It was constructed at the turn of the century and soon seized by the communists to house bureaucrats and impress foreign guests. The count, though, is consigned to a tiny room on the top floor, crammed with a few pieces of his fine furniture and a set of porcelain plates. This is a character who has “opted for the life of the purposefully unrushed.” He was raised to appreciate the great conveniences of life, such as keeping “a carriage waiting at the door of one party, so that on a moment’s notice it can whisk you away to another.” Now, that extravagant life must somehow be adjusted to the tight confines of a servant’s bedroom. No matter: The man makes the home, not the other way around, and the count is convinced that “by the smallest of one’s actions one can restore some sense of order to the world.”

This is not a novel of thrilling conflicts so much as charming encounters. As the years pass, the count always behaves as a perfect gentleman. He never complains about his confinement — never even admits that it is a confinement. He entertains attractive guests. He spars good-naturedly with a staff member who resents his refined manner. And he even finds himself acting as the father to a young girl whom Towles has called his “Eloise of the Metropol.”

As prison sentences go, life in the Hotel Metropol sounds a lot harder on the novelist than on the count. After all, Alexander Rostov might be able to pretend that his little attic room can “provide the satisfactions of traveling by train,” but for the writer, the task of describing decades in a single building sounds frighteningly cramped. And yet, remarkably, in Towles’s hands, it’s a wonderfully spacious setting. As he creates it, the Hotel Metropol is transfixing, full of colorful characters: some transitory, others permanent; mostly fictional, some historical. Yes, the novel offers more high tea than high adventure, but this is a story designed to make you relax, to appreciate your surroundings, to be a person on whom nothing is lost. And don’t worry: There’s some gripping derring-do in the latter parts. (Hollywood: Why haven’t you snapped this up?)

The novel’s trickier challenge is the potential for glibness. There could easily have been something unseemly about a light comedy that takes place against the background of two world wars and the fathomless horrors of Stalinism — “Hogan’s Heroes” with room service. Towles’s solution is wry understatement that extends to a series of historical footnotes. “Let us concede,” he says at the start of one chapter, “that the early thirties in Russia were unkind.” It’s an approach that allows him to pursue his warmhearted story while acknowledging, with Russian irony, the ocean of suffering taking place all around it.

Admittedly, the whole enterprise depends on how deeply you fall in love with the count. (I began to wear an ascot and affect a brittle chuckle around the house until my wife told me to cut it out.) Although Towles tells the story in the third person, there’s clearly some deep sympathy here between the protagonist and the author, who retired from a lucrative career in finance to write fiction. His omniscient narrator is only a few tones away from the count’s own voice — dusted with wit and given to statements of feigned melodrama, such as, “Surely, the span of time between the placing of an order and the arrival of appetizers is one of the most perilous in all of human interaction.” It’s that crisp, light humor that keeps the count from sounding preachy even as he assumes a kind of quiet authority in an ugly world. “The Count had restricted himself to two succinct pieces of parental advice,” Towles tells us. “The first was that if one did not master one’s circumstances, one was bound to be mastered by them; and the second was Montaigne’s maxim that the surest sign of wisdom is constant cheerfulness.”

In our own allegedly classless society, we seem to have retained only what’s deplorable about aristocracy — the oppression, the snobbery, the racism — and thrown out those qualities that were worth retaining. Which makes “The Gentleman of Moscow” an endearing reminder of the graciousness of real class. It has nothing to do with money; it’s predicated on the kind of moral discipline that never goes out of style.

Ron Charles is the editor of Book World. You can follow him @RonCharles.

A Gentleman in Moscow

By Amor Towles

Viking. 480 pp. $27