Van Morrison’s “Astral Weeks” has always seemed like a fluke. In November, 1968, the irascible songwriter from Belfast released a jazz-influenced acoustic song cycle that featured minimal percussion, an upright bass, flute, harpsichord, vibraphone, strings, and stream-of-consciousness lyrics about being transported to “another time” and “another place.” The album was recorded in three sessions, with the string arrangements overdubbed later. Many of the songs were captured on the first or second take. Morrison has called the sessions that produced the album “uncanny,” adding that “it was like an alchemical kind of situation.” A decade later, Lester Bangs called the album “a mystical document” and “a beacon, a light on the far shores of the murk.” Bruce Springsteen said that it gave him “a sense of the divine.” The critic Greil Marcus equated the album to Bob Beamon’s record-shattering long-jump performance at the Mexico City Olympics, a singular achievement that was “way outside of history.”

Ryan H. Walsh’s new book, “Astral Weeks: A Secret History of 1968,” takes up Morrison’s sui-generis masterpiece and unearths the largely forgotten context from which it emerged. Though the songs on “Astral Weeks” were recorded in New York and are full of references to Morrison’s childhood in Northern Ireland, they were, in Walsh’s words, “planned, shaped and rehearsed in Boston and Cambridge,” where Morrison lived and performed for much of 1968. In documenting the milieu out of which the album came, Walsh also argues for Boston as an underappreciated hub of late-sixties radicalism, artistic invention, and social experimentation. The result is a complex, inquisitive, and satisfying book that illuminates and explicates the origins of “Astral Weeks” without diminishing the album’s otherworldly aura.

What was Morrison doing in Boston? The short answer is that he was hiding out. Stymied but full of ambition, the twenty-two-year-old songwriter had come to New York, in 1967, burdened by an onerous recording contract with the Bang Records producer Bert Berns, who’d worked with Morrison’s band Them, and who had also produced Morrison’s hit single “Brown Eyed Girl.” When Berns died of a heart attack, in December, the contract came under the supervision of a mobster friend of Berns named Carmine (Wassel) DeNoia. One night, Morrison, whose immigration status was tenuous at best, got into a drunken argument with DeNoia, who ended the conversation by smashing an acoustic guitar over the singer’s head. Morrison promptly married his American girlfriend, Janet Rigsbee (a.k.a. Janet Planet), and escaped to Boston.

Boston was home to the other major figure in Walsh’s book, Mel Lyman, a musician who reinvented himself as the messianic leader of a commune in the Fort Hill area of Roxbury, where he and his followers, known as the Lyman “Family,” commandeered an entire neighborhood of houses. As Walsh notes, the Fort Hill Community “attracted followers of a pedigree far more impressive than that of your run-of-the-mill sixties commune,” including Jessie Benton, the daughter of Thomas Hart Benton; Mark Frechette, the star of Michelangelo Antonioni’s film “Zabriskie Point”; Paul Williams, the founder of the music magazine Crawdaddy; two children of the novelist Kay Boyle; and Owen deLong, a former speechwriter for Robert Kennedy. Lyman controlled every aspect of life in Fort Hill. Members who had trouble following the rules might be given an LSD trip, guided by Lyman himself, or subjected to a rigged astrological reading. Commune members were also expected, among other duties, to distribute the provocative biweekly underground newspaper Avatar. Lyman died in 1978, but his death was kept secret until the mid-eighties. The Fort Hill Community, unlike so many other sixties communes, still exists.

There’s no evidence that Morrison and Lyman ever met, but their trajectories through the book operate like melodic counterpoints. With his harmonica, Lyman serenaded mournful fans who were departing the Newport Folk Festival in 1965, after Bob Dylan’s scandalous electrified set. In “Astral Weeks,” Morrison abandoned the amplified sound of his earlier work in favor of acoustic instruments. Lyman was a charismatic leader able to create and sustain a community through the force of his character. Morrison was hotheaded and irritating to many of the musicians who played with him, and he exasperated a series of managers. Both men believed fiercely in the power of their own internal visions and were propelled by the tumult of the late sixties. Each has a legacy that endures half a century later.

Walsh fills out the book with a plethora of other figures, famous and obscure, who were living in or passing through Boston during that year. There was David Silver, a Tufts University Shakespeare scholar from England, who created the wildly experimental television show “What’s Happening, Mister Silver?” “It was the first TV show that spoke to the stoned generation,” Peter Simon, the younger brother of the singer-songwriter Carly Simon, said. There were the members of the Velvet Underground, who played at the Boston Tea Party, a local rock venue, fifteen times in 1968. (Lou Reed called it “our favorite place to play in the whole country.”) There was Peter Wolf, the future front man of the J. Geils Band, who worked as a late-night disk jockey on WBCN, a free-form station that Morrison liked to call in to. Wolf’s early band, the Hallucinations, played gigs with the Velvet Underground, Howlin’ Wolf, and other notable acts in Boston. Jonathan Richman, who would found the Modern Lovers, in 1970, was in the audience for some of those shows and serves as a source for Walsh.

This flourishing of countercultural activity was not accidental. Its foundations were laid a decade earlier. Walsh writes that “in the late fifties and early sixties, Boston and Cambridge served as ground zero for both the folk music revival and the origin of the American hallucinogenic revolution.” Boston was where Timothy Leary and Richard Alpert started the Harvard Psilocybin Project, under the auspices of which they conducted experiments on the effects of psychotropic drugs. Mel Lyman took LSD at Alpert’s house. Alpert later travelled to India, returning to Boston as a spiritual guru with the name Ram Dass. His best-selling book, “Be Here Now,” published in 1971, introduced many readers to Hindu spirituality and yoga. It also inspired the George Harrison song of the same title.

The common thread among the myriad personalities and communities profiled by Walsh is a yearning for transcendence and rebirth. These are also the central themes of Van Morrison’s “Astral Weeks.” Morrison’s route to the spiritual plane was through music, not drugs. (A notorious drunk during his time in Boston, he is said to have eschewed dope after “burning [his] brain on hash” when he was younger.) The singer seems to have been guided by his subconscious in creating “Astral Weeks.” Some of the songs emerged from dreams and reveries. Morrison was a student of the occult who believed in automatic writing.

Morrison spent the summer of 1968 playing rock clubs, roller rinks, high-school gyms, and amusement parks across New England with a group of local musicians, under the banner the Van Morrison Controversy. While Morrison was refining the songs that would become “Astral Weeks,” a Warner Brothers executive named Joe Smith, who’d seen Morrison perform in Boston, bought his Bang Records contract from the Mob with a bag full of cash. “He was a hateful little guy,” Smith said of Morrison, “but . . . I still think he’s the best rock ’n’ roll voice out there.” Smith dispatched the producer Lewis Merenstein to audition Morrison in Boston, in September of 1968. Upon hearing him perform “Astral Weeks,” Merenstein said, “What are we wasting time for? Let’s go make a record.”

So what magic happened during those three recording sessions on West Fifty-second Street? At Merenstein’s insistence, most of the band Morrison had been touring with that summer were not invited to the studio. Instead, the producer gathered an élite group of session musicians, featuring the bassist Richard Davis, who had performed with Sarah Vaughan and Oscar Peterson, and the guitarist Jay Berliner, who had recorded with Harry Belafonte and Charles Mingus. Perhaps intimidated by the company he was in, Morrison skulked to the vocal booth and kept his interactions with the musicians to a minimum. Davis recalls that Morrison strummed his songs once or twice for them and then let them improvise their parts as the tapes rolled. It hardly seems like a recipe for success, but it was very much in keeping with the unstructured and unorthodox temper of the time. Merenstein and the musicians were thrilled with the results, but Morrison, ever the contrarian, had a different opinion. “They ruined it,” he said later. “They added strings. I didn’t want the strings. And they sent it to me, it was all changed. That’s not ‘Astral Weeks’.”

For the rest of us, though, it very much is.