NEW YORK — On Broadway, the spring season has brought imperfect productions of two transcendent musicals, West Side Story and Guys and Dolls. Now, to redress the balance, there’s a transcendent production of an imperfect musical.

Hair is duly beloved for its scrumptious rock-candy score and for vividly capturing an indelible and pivotal moment in our history and culture. But like its very young, Vietnam-era characters, the story has more energy than focus. In the wrong hands, it can easily become a quaint, cloying mess.

The new Public Theater revival ( * * * * out of four), which opened Tuesday at the Al Hirschfeld Theatre, not only avoids potential obstacles but finds a resonance in Hair beyond any parallels between the turbulent ’60s and our own troubled times. What director Diane Paulus and her flawless cast have achieved is a testament to the indomitability and transience of youth, with all the blissful exuberance and aching poignance that entails.

The Public introduced this Hair off-Broadway last summer, staging it outdoors as part of its Shakespeare in the Park festival. Inside the Hirshfeld, Paulus and crew have kicked down the fourth wall and gleefully stomped all over it. The hippies populating this “American Tribal Love-Rock Musical” dance and frolic in the aisles, inviting audience members to join them. Flowers are distributed, hugs offered. At a recent preview, one tribe member escorted a woman who had wandered in late after intermission back to her seat.

As a result, the show feels even more immediate and, well, communal than it did in the open air. There’s no escaping these wild children and their unbridled lust for life, and no wanting to. Similarly, after the central character, Claude, receives his draft notice and is forced to confront a more bitter reality, we, too, are moved and torn. Suffice to say that if you’ve ever doubted the elegiac weight of Let the Sun Shine In, you’ll be convinced here.

All the performers are at once technically supple singers and superb musical actors. The empty showmanship so prevalent in pop and musical theater would seem particularly out of place among Hair‘s earthy young men and women. When Gavin Creel’s Claude sings Where Do I Go, or Caissie Levy, as the feisty but vulnerable Sheila, delivers a stunning Easy to Be Hard, we believe every word and feel every note.

This graceful earnestness is complemented by an equally authentic sense of humor and mischief. Will Swenson’s feral Berger and Darius Nichols’ sly, bracing Hud are delightful, and Andrew Kober has a priceless turn as a “visitor from another generation.” Allison Case, Bryce Ryness and Kacie Sheik also provide funny and touching moments.

But this Hair is more than the sum of its groovy, glorious parts. Anyone who can is advised to tune in and turn on, and be prepared for an exhilarating ride.