Coming-of-age movies are hardly rarities, and they often involve rock music. But though “We Are The Best!” falls into that category, it’s a delightfully distinctive example of it. Lukas Moodysson’s picture is a period piece, set in 1982 Stockholm, about three thirteen-year old girls who form a punk band. In the process they deepen their friendship and grow as individuals. It’s a simple, though episodic, narrative through-line, but Moodysson presents it in a vivid, unkempt fashion that mirrors the girls’ eccentric personalities, and the result is a charming, ebullient portrait that only occasionally goes in expected directions.

Moodysson’s script, based on a graphic novel titled “Never Goodnight” by his wife Coco, begins with inseparable friends Bobo (Mira Barkhammar) and Klara (Mira Grosin). Klara is the more volatile and rowdy of the two, a pint-sized rabble-rouser who sports a mohawk and disparages her older brother Linus (Charlie Falk) for having abandoned his earlier devotion to punk. She lives with him and their squabbling middle-class parents. By contrast, the bespectacled, short-haired Bobo, who lives with her divorced mother (Anna Rydgren), is more reserved and serious, though when paired with her pal she can cut loose, too.

Both girls complain endlessly about their home lives, their schoolmates and the musical tastes of others, and cause havoc at the local youth center when they displace a heavy-metal band from the rehearsal room by claiming to need it for practice sessions although neither plays an instrument. Sensing that mere enthusiasm isn’t enough, they enlist a classmate, Hedvig (Liv LeMoyne), in their abruptly-formed group. She’s a quiet, conventionally pretty girl, shunned by most of her classmates, who’s skilled in classical guitar; and the religiosity of her mother is a strike against her, at least as far as Klara is concerned. But she has musical talent, and may be able to teach the duo some useful information about such mysterious things as chords. Before long she’s been drawn into Bobo and Klara’s orbit, though her new short hairdo earns a reproach from her mom, and a threesome has been formed.

“We Are The Best!” strays into more predictable territory when the girls make the acquaintance of a couple of punk boys, Elis (Jonathan Salomonsson) and Mackan (Alvin Strollo), and both Klara and Bobo have eyes for the cuter of the two, causing a rift between them. But that isn’t allowed to dominate the proceedings very long, and it’s the girls’ unified opposition to everything that represents normalcy and order—including well-meaning adults like Klara’s clarinet-playing dad (David Dencik) and Kenneth and Roger (Johan Liljemark and Mattias Wiberg), the hopelessly square guys who run the youth center—that remains the focus of the piece, especially when the trio is enlisted to perform at a Christmas concert in a nearby town at cause a ruckus with their androgynous appearance and their anti-establishment anthem “Hate the Sport!” (The punker boys’ big song, “Brezhnev and Reagan, F**k Off,” is no slouch, either, and LeMoyne contributes a couple of sweet folk ballads.)

Moodysson secures wonderfully natural performances from his entire cast, with the three girls standing out but everybody around them, adults and youngsters alike, contributing fine supporting turns. The exuberance of the trio is mirrored in the mobile, roving camerawork of Ulf Brantas, whose hand-held style doesn’t go all jittery as is often the case but proves a perfect vehicle for capturing their emotional vibrancy; and the period is reflected more subtly than usual in such pieces in the production design of Linda Janson and Paola Holmer and Moa Li Lemhagen Schalin’s costumes.

The spirit of genial youthful rebelliousness has seldom been expressed with such effortless glee as here. “We Are The Best!” is messily affectionate in all the right ways, a film it would take a real curmudgeon to dislike.