Mr. Pirsig works on a motorcycle in 1975. (William Morrow via AP)

Robert M. Pirsig, whose ­­1974 travelogue-cum-philosophical tract, “Zen and the Art of Motorcycle Maintenance,” sold millions of copies and made him a reluctant hero to generations of intellectual wanderers, died April 24 at his home in South Berwick, Maine, He was 88.

William Morrow, the publishing house that accepted Mr. Pirsig’s manuscript after 121 other publishers had turned it down, announced his death. The cause was not disclosed.

Zen and the Art of Motorcycle Maintenance: An Inquiry Into Values” was an instant classic — a work of literature that captured the spirit of its time and retained its appeal long after the hippie movement had faded.

The book was ostensibly drawn from a motorcycle trip that Mr. Pirsig took with his 11-year-old son Chris in 1968, from their home in Minnesota, across the Dakotas and on to California. But it also contained an erudite elaboration of a philosophical theory that Mr. Pirsig termed the “Metaphysics of Quality.” It touched on Eastern and Western thought, the counterculture, and Mr. Pirsig’s struggles with mental illness that had been diagnosed as schizophrenia.

Mr. Pirsig had committed to paper his personal, private thoughts, he once observed, “and they turned out to be the personal, private thoughts of everyone else.”

Despite its abstruse prose, the book was critically and popularly cheered. It earned comparisons to Jack Kerouac’s “On the Road” and Herman Melville’s “Moby-Dick” — but only after Mr. Pirsig found a publisher willing to print his work.

“The book is brilliant beyond belief,” his editor, James Landis, wrote, according to a statement provided by William Morrow. “It is probably a work of genius and will, I’ll wager, attain classic status.”

George Steiner, writing in the New Yorker magazine, was among those critics who saw in Mr. Pirsig’s disquisition on motorcycle maintenance parallels with Melville’s explanations of whaling.

Steiner wrote: “A detailed technical treatise on the tools, on the routines, on the metaphysics of a specialized skill; the legend of a great hunt after identity, after the salvation of mind and soul out of obsession, the hunter being hunted; a fiction repeatedly interrupted by, enmeshed with, a lengthy meditation on the ironic and tragic singularities of American man — the analogies with Moby-Dick are patent.”

Mr. Pirsig’s book transformed him from an obscure technical writer into one of the best known authors of his era. Fame discomfited him, however. His book jackets include no photo of the author. Once, replying to a New York Times reporter who inquired where he lived, he declined to respond with more specificity than “somewhere in New England.” He rarely submitted to interviews.

Mr. Pirsig preferred to let “Z.M.M.” — his preferred abbreviation for his book — and its 1991 sequel, “Lila: An Inquiry Into Morals,” speak for themselves. And the volumes spoke forcefully, attracting a cult following of fans who became known as “Pirsig’s pilgrims.”

The first five words of its title became a cultural catchphrase; among the many books over the years that borrowed Mr. Pirsig’s phrase were “Zen and the Art of Casino Gaming” and “Zen and the Art of Changing Diapers.” (An earlier installment in the category, preceding Mr. Pirsig’s work, had been Eugen Herrigel’s “Zen in the Art of Archery.”)

Reissued in 1984 on its 10th anniversary, “Zen and the Art of Motorcycle Maintenance” had by then taken on a tragic cast: Mr. Pirsig’s son Chris had been killed by muggers in 1979 in San Francisco, where he lived at a Zen center. “I go on living, more from force of habit than anything else,” Mr. Pirsig wrote.

Robert Maynard Pirsig was born on Sept. 6, 1928, in Minneapolis, where his father was dean of the University of Minnesota Law School. Mr. Pirsig was described as a genius, with an IQ of 170, and graduated from high school at 15.

In his youth he bounced between the United States and Asia, where he first traveled while serving with the Army in Korea. He later deepened his knowledge of Eastern philosophy during travels in India. He received a bachelor’s degree in philosophy in 1950 and a master’s degree in journalism in 1958, both from the University of Minnesota.

He taught at Montana State College and the University of Illinois and worked as a technical writer before embarking on the road trip with his son. He was hospitalized for a period for mental illness and endured electroshock therapy.

In addition to his skill at motorcycle maintenance, Mr. Pirsig was a skilled navigator and twice sailed the Atlantic, according to William Morrow. His book “Lila,” also part travelogue, part philosophical work, substituted a sailboat for the motorcycle of “Z.M.M.”

Mr. Pirsig’s marriage to Nancy James, with whom he had two sons, ended in divorce. In 1978, he married Wendy Kimball. Besides his wife, of South Berwick, survivors include a son from his first marriage, Ted Pirsig of Volcano, Hawaii; a daughter from his second marriage, Nell Peiken of Middleton, Mass.; and three grandchildren.

“Zen and the Art of Motorcycle Maintenance” was celebrated in part for the dichotomies it established: between father and son, between mechanical knowledge and artistic sensibility, between Western and Eastern values.

It also blurred the line between fiction and nonfiction. Mr. Pirsig described the work as a “nonfiction book embedded in a novel” but said that it made “no difference” to him how his publisher marketed it. It was the “same book either way,” he told the London Independent.

As for the motorcycle of the title, “the real cycle you’re working on,” he wrote, “is a cycle called ‘yourself.’ ”