Most countries have a writer like him: the bearded eminence whose face adorns postage stamps, and whose name dignifies avenues, and whose Complete Works sit, undisturbed, on grandparents’ bookshelves. Since no one can graduate from high school without feigning knowledge of his work, many people read him far too young, and come to view him as a child might regard an improving vegetable.

Joaquim Maria Machado de Assis, Knight of the Imperial Order of the Rose, founder of the Brazilian Academy of Letters, has long been Brazil’s ambassador to the international society of official writers. He seemed to be preparing for the role for most of his adult life, which was so colorless and conventional it might have been taunting future biographers.

An outstanding employee of the Ministry of Agriculture, Commerce, and Public Works, Machado, like Kafka (of the Worker’s Accident Insurance Institute) and Cavafy (of the Third Circle of Irrigation), wore prim suits, lived in nondescript neighborhoods, worked bureaucratic jobs, and rarely stirred from the city where he was born.

These authors looked like emblems of the petit bourgeois, and the gap between their appearance and their writing made them emblems of something else, too—of the inner life pulsing behind the mask that the modern person dons. That gap allowed such writers to take on an electric symbolism. By presenting no outward challenge to their epochs, they could move freely through them—and eventually define them.

Machado “had a half dozen gestures, habits, and pat phrases,” an early biographer, Lúcia Miguel Pereira, wrote, in 1936. He avoided politics. He was an ideal husband. He spent his free time at the bookshop. And, in founding the Academy of Letters, he brought an administrative structure to literature.

Yet to place this image beside his books is to wonder whether such diligence was a carefully calibrated act—and to see why, despite more than a century’s veneration, the vestment of national spokesman will never quite fit. Machado was too ironic, too mischievous, for the pretentions that the official homages imply. In stories about the polite society of Rio de Janeiro, he managed, with unruffled elegance and composure, to say the most outrageous things. A drag queen might have called this decorous performance “executive realness.”

Even when he was young, his mysterious background fascinated observers, though it did not much seem to fascinate him. He was forty when a journalist declared it would be impossible to write his biography: “There exists no one more reserved on this subject than he.” Observers gleaned what little they could. He was short, epileptic, and a stutterer. And they could see that he was mulato, of partial African descent.

This ancestry is often the first fact mentioned about his life. In “The Collected Stories of Machado de Assis” (Liveright), a landmark volume that will be the first place that most Americans encounter him, he is introduced as “the grandson of ex-slaves.” It is not a label he would have elected. His mother was white, an immigrant Azorean washerwoman who died when he was nine; his father, though, was a mixed-race housepainter whose parents had, indeed, been enslaved.

In the broader panorama of Brazilian society, this was unremarkable. (Most Brazilians were of mixed race.) So was his class background. Most Brazilians were poor, and Machado’s origins were a step above misery. His parents were literate. They belonged to the working class rather than to the lowest class—the enslaved.

But people of visibly mixed race were rare in the higher society that Machado entered while relatively young. As a boy, he had a knack for befriending helpful people: legend has it that a priest taught him Latin; an immigrant baker, French. At seventeen, working at a printer’s shop, he met intellectuals, and was soon publishing poems.

He was, at best, an indifferent employee. He was too busy reading, and did not earn enough to allow him to eat more than once a day. Yet the work he published, plays and poetry at first, was instantly acclaimed by a small but influential circle, and his first novel, “Resurrection,” published in 1872, inaugurated a critical success that continued until his death, thirty-six years later.

Machado’s unlikely social ascent attracted comment. Those who disliked him held his origins against him: one critic, in 1897, called him a “genuine representative of the mixed Brazilian sub-race.” Even his champions couldn’t help themselves. Miguel Pereira makes nearly forty mentions of his racial background—mostly gratuitous—in the three hundred pages of her biography.

The focus on this facet of his origin story obscures other surprising facts about his life. He was born in 1839, seventeen years after Brazilian independence—and only thirty-one years after the first book was printed in Rio de Janeiro. For three hundred and eight years after the Portuguese first reached Brazil, printing was forbidden throughout the colony. An entire country was not allowed to think for itself.

What kind of literature did a new nation need? As in other American countries, many Brazilian writers born immediately after independence tried to forge a consciousness through indigenous motifs. The poet Gonçalves Dias published Indianist epics and a dictionary of Tupí; the novelist José de Alencar placed Indians—especially women—at the center of a new mythology.

This vision of Brazil had long appealed to outsiders, too. In 1550, fifty Tupinambás were brought to Normandy to re-create a Brazilian village for the king’s entertainment. Centuries later, that village was what most foreigners thought of when they thought of Brazil: an unspoiled tropical paradise, swarming with noble savages. Yet—boringly enough—Brazil turned out, in so many ways, to be far more familiar than they imagined. This might be one reason that Machado never really caught on abroad. He was not interested in national folklore, and described a milieu not too distant from that of Henry James or Edith Wharton. His books are almost exclusively concerned with the rich, more or less idle, of Rio de Janeiro, and this was not a Brazil most foreigners recognized.

Even for a Brazilian writer, Machado’s work was oddly devoid of local color. If some found him too black, others found him not quite black enough: not nearly as concerned with social questions as one of his background ought to have been. Brazil, after all, was the largest slaveholding country in the world, and the last in the Americas to outlaw slavery. In 1888, when abolition finally came, Machado was almost fifty.

Intellectuals were preoccupied with the legacy of slavery at a moment when “scientific racism” and its relatives, including social Darwinism, were ascendant. Races could develop on their own, the theory went, but miscegenation would cause decline. According to this racial pseudoscience, Brazilian attempts to modernize were doomed: the nation, with its irreversibly mixed population, was condemned to permanent inferiority.

Machado’s reputation benefitted from a twist in the debate only a generation after his death, in 1908. A series of books, beginning, in 1933, with Gilberto Freyre’s “The Masters and the Slaves,” turned miscegenation, once a source of fear and shame, into a font of national pride. As the Ku Klux Klan resurged in the United States, Brazil earned a reputation for being a country where racial lines had been so blurred that they no longer mattered. (Racial democracy, as it was called, ignored Brazil’s ferocious history of slavery and racism.) It was convenient that Brazil’s greatest writer was of mixed race, and could become a symbol of these newly recast values. One suspects Machado would have been embarrassed by this posthumous role.