At the dawn of the so-called Summer of Love in 1967, hippies were officially not welcome in San Francisco. But even after being specifically uninvited by Mayor John F. Shelley, as well as warned off by the entire Board of Supervisors, youth from across America by the tens of thousands descended on San Francisco as soon as school let out. The sidewalks of Haight Street soon clogged with inelegant, itinerant young misfits.

What they were seeking had already evaporated for the most part, and, with their arrival, all but vanished entirely. By July, there was open warfare on Haight Street between the hippies and the police. Muni rerouted buses to keep the solid citizens safe from the mini-Sodom. In August, George Harrison of the Beatles toured the streets of Haight-Ashbury, trailed like the Pied Piper by a procession of the flotsam and jetsam that had washed up on Haight Street sidewalks that summer. He later reported the experience turned him off using drugs for the rest of his life.

By the end of that summer, the flower children had been replaced by the street people, and the whole hippie thing was headed for the hills. The Grateful Dead, on tour at the time, had dispatched their women’s auxiliary to scout rural commune sites in New Mexico, while a handful of Pranksters squatted at the Dead’s headquarters at 710 Ashbury St. They weren’t long for the neighborhood.

Still, here we are, 50 years later, marveling at the hippies, who came and went as mysteriously as the Druids, and wondering: What was that? They left behind a vague but definite cultural imprint, a kind of peculiar residue that shows up at places like yoga studios in strip malls or organic vegetable stands at the farmer’s market. That flash on the horizon that lit up the world from the ground zero of Haight-Ashbury a half-century back has never been fully extinguished. No matter how commercialized, corrupted, disintegrated, defiled or reviled the hippies have been, they refuse to disappear. Part of the reason was that Boomers have always remembered their youth. At the same time, the inaccurate mythology of the Summer of Love was such that younger generations have tried to replicate it.

It was an amazing time. At the center of the Haight-Ashbury’s genuine sense of community was a raft of remarkable rock bands, crazy artistic virtuosos, almost entirely unheard of at the time outside San Francisco.

Exciting new music was everywhere. On one typical weekend that May, music fans could choose from Jefferson Airplane and a Canadian rock band called the Paupers at the Fillmore; the Doors and the Sparrow (later known as Steppenwolf, “Born to be Wild”), two Los Angeles bands at the Avalon Ballroom on Sutter Street; Big Brother & the Holding Company with Country Joe and the Fish at California Hall; Sopwith Camel at the Matrix; Steve Miller Blues Band at UC Berkeley; Sir Douglas Quintet at the Ark in Sausalito; or go catch the Airplane playing for free on a Sunday afternoon at the Golden Gate Park Panhandle.

Then there was the third week in June after the Monterey International Pop Festival when the then-unknown Jimi Hendrix Experience was scheduled to open a six-night run by Jefferson Airplane at the Fillmore. After being wiped off the stage by Hendrix the first night, the Airplane hightailed it out of town the next day for Los Angeles to work on the band’s new album. Big Brother was hired to fill in for the rest of the week, but there were no hard feelings between Hendrix and the Airplane — they loaned him their flatbed truck that Sunday afternoon to play a free concert in the Panhandle before a crowd of a few hundred flabbergasted onlookers.

The music was sublime, inventive and intoxicating. Concert producer Bill Graham began throwing regular shows at the Fillmore in early 1966, and a few weeks later, Chet Helms and his commune called the Family Dog took over the Avalon Ballroom at Sutter and Van Ness. Anybody who gained admission to either of those establishments was transported into an alternative universe. Everybody who found their way there knew how wonderful the whole thing was and immediately embraced everybody else as fellow members of a special secret society.

There were no spotlights on the bands. The rooms were blanketed in swirling, pulsing colored light projections run by often as many as a dozen people. Helms, more a hippie visionary than a simple concert producer, always likened the experience to a Dionysian revelry in which there was no distinction between the audience and the performers. The pungent fragrance of marijuana permeated the rooms. Many of the people in the audience were high on LSD. Many of the musicians onstage were also on acid. Everyone danced.

Make no mistake, those ballrooms were LSD speakeasies in 1966. At the center of everything that was going on was the revolutionary psychedelic drug. After spending two weeks studying the literature in UC Berkeley’s Dow Library, ex-student Augustus Owsley Stanley III became the first private party to synthesize the mind-expanding chemical compound in 1964. Beginning in a small lab in his Berkeley home, Stanley may have produced the first million doses of acid, which was not made illegal until October 1966, effectively starting the global psychedelic revolution in San Francisco.

Under the influence of LSD, the hippie rock musicians, largely former folk musicians in their 20s who had given up rock and roll when they were teens, shattered the existing rock orthodoxy. With chemically compatible crowds dancing as the bands played, the musicians stretched songs into epic instrumental flights, way past the three-minute pop songs of top 40 radio. Their music was informed by a wide, bright and colorful array of influences. San Francisco Chronicle music columnist Ralph J. Gleason was intrigued to hear guitarist Jerry Garcia of the Grateful Dead proclaim his devotion to gypsy jazz guitarist Django Reinhardt. That was not what you expected from a rock ’n’ roll musician.

Without even being heard outside the ballrooms, San Francisco bands bloomed in the imagination of the counterculture everywhere. The new album “Sgt. Pepper’s Lonely Hearts Club Band” by the Beatles, due to be released in June, was preceded by headline news around the world that the members of the group had all “experimented” with LSD. In May, Paul McCartney borrowed Frank Sinatra’s Learjet to make a stealth visit to San Francisco, carrying a test pressing of the new album when he arrived unannounced at a Jefferson Airplane rehearsal. Everybody repaired to the Airplane mansion, their massive Fulton Street Victorian across the street from Golden Gate Park, for a psychedelic summit.

That summer, the Airplane was the hottest new band in the country. The band’s second album, “Surrealistic Pillow,” had been released in February and had already launched two major hit singles — “Somebody to Love” and “White Rabbit” — that were both instant hippie anthems.

After the Monterey Pop Festival, the entire music world turned its attention on San Francisco.

While the music broadcast a coded message to young people everywhere, the establishment recoiled in shock and horror at these wacky, gentle unkempt children. The movement, such as it was, had simply exploded.

In San Francisco, crowds grew exponentially in the first year. It went from 1,000 people who attended the first acid rock dance/concert at Longshoremen’s Hall in North Beach in October 1965, to as many as 100,000 people who showed up at the Human Be-In at the Golden Gate Park Polo Field in January 1967.

A couple is seen at the Human Be-In at the Polo Fields in Golden Gate Park in 1967.

A couple is seen at the Human Be-In at the Polo Fields in Golden...

Hippies became a subject of fascination by the national media. There was an endless parade of cluck-clucking magazine and newspaper articles. In their exuberant, joyful rejection of conventional values, the hippies clearly struck a nerve.

CBS News sent the august Harry Reasoner to investigate. He crawled the streets of the Haight-Ashbury, interviewed the Grateful Dead, leaned against a tree in the Panhandle as the Dead played a free concert down the street, and summed up his thoughts for the camera.

“There are the hippies,” Reasoner intoned. “They make you uncomfortable because there is obviously something wrong with the world they never made if it leads them to these grotesqueries. But granting the faults of society, you can say three things about them. They, at their best, are trying for a kind of group sainthood, and saints running in groups are likely to be ludicrous. They depend on hallucination for their philosophy. This is not a new idea and it has never worked. And finally, they offer a spurious appeal to the young, a corruption of the idea of innocence. Nothing in the world is as appealing as real innocence. But it is, by definition, a quality of childhood. People who can grow beards and make love are supposed to move from innocence to wisdom.”

All over the country, young people listened to responsible spokesmen like Reasoner and thought “those hippies sound great. … I’m going to go to San Francisco.”

On the radio, “San Francisco (Be Sure to Wear Flowers in Your Hair)” by Scott McKenzie, a massive hit song across the nation that June, explicitly advertised the idea. As summer dawned on the horizon, that song carried the message: “If you’re going to San Francisco…”

Summer of Love

And came they did, even if the reality proved to be somewhat more squalid than the pop song suggested. The sordid reality of kids living on the streets like refugees, panhandling for food, a sudden epidemic of speed and toxic psychedelics laced with animal tranquilizer (and worse) left something to be desired for many. As early as the first week in June, authorities reported sending as many as 10 young people home each day. Police sweeps on Haight Street quickly grew nasty, and all the old-timers on the street knew the scene had come to an end.

So, as San Francisco comes together to welcome yet another invasion of visitors drawn by the Summer of Love myth to celebrate the golden anniversary of this famous time in the city that wasn’t all that lovely, hippies are, once again, back in the spotlight.

Like the cowboys and Indians of the original Wild West, the San Francisco hippies have lived to become an enduring American archetype that is recognized around the world.

Joel Selvin is the former San Francisco Chronicle senior pop music critic and author of “Summer of Love: The Inside Story of LSD, Rock & Roll, Free Love and High Times in the Wild.”