Gus Van Sant returns to more conventional filmmaking after nearly a decade of minimalist work with “Milk,” easily his most accessible, audience-friendly work since “Finding Forrester.” But the director of the masterful “Gerry” and “Elephant” hasn’t gone entirely mainstream; the film is an account of the life of the San Francisco city supervisor who was the first openly gay man elected to a major office in the United States (assassinated, along with the mayor, by another supervisor in 1978). And although gay-themed Hollywood films aren’t as rare as they used to be when “Philadelphia” came out in 1993, they’re still sufficiently infrequent to form a relatively small category (despite the success of “Brokeback Mountain”).

And this one, all considerations of sexual preference aside, easily ranks as one of the best biographical movies in years, just as “Brokeback” was one of the most powerful relationship pictures in a long while. Skillfully written and structured, cannily employing a mixture of archival footage and newly-shot material made with an astonishing feel for period detail, and topped by a grand performance by Sean Penn that reaffirms his place in the top ranks of American actors, Van Sant’s film is to some extent a statement, but also a crowd-pleaser of the highest caliber. It will have special appeal for gay audiences, but anybody with a reasonably open mind should find it affecting and uplifting. In fact, it’s so good that even the inevitable updates on characters that come at the close are welcome.

“Milk” isn’t a full biography; using a 1978 taped recollection by Milk as a framing device, it introduces him in 1970 on his fortieth birthday as a still closeted man in New York City, when he has a “cute” meeting in the subway with handsome Scott Smith (James Franco). The two shortly move together to San Francisco’s Castro district and open a camera shop. There, despite a growing gay population in the area, they find the local hostility and the police mistreatment as prevalent as anywhere—a circumstance that leads Milk into political activism and repeated campaigns for political office that run counter to the more subdued approach of the “establishment” gay community in the city, embodied by Advocate publisher David Goodstein (Zvi Howard Rosenman).

Though the film touches on Milk’s relationships with Smith (eventually strained beyond repair by all the politicking) and later with Jack Lira (Diego Luna), an unstable Latino who ultimately can’t deal with his lover’s absences, the focus isn’t on his private life but his public career. (Indeed, though the Harvey-Scott pairing is presented with charm and an agreeable lightness of touch—with Franco showing still more evidence of surprising range after his hilarious turn in “Pineapple Express”—the whole subplot involving Lira weighs things down, perhaps because it’s never treated with sufficient depth to make us care much about the doomed Jack, whom in any event Luna plays—perhaps accurately, but not very sympathetically—as a continuous irritant).

But we get an exhilarating account of Milk’s multiple runs for the supervisor position, during which he assembles a raft of colorful supporters led by high spirited Cleve Jones (Emile Hirsch, in a well-judged turn that makes one forget his “Speed Racer” disaster) and campaign manager Anne Kronenberg (bright, likable Alison Pill). And later on, the picture skillfully covers Milk’s role in the battle against the proposition put on the ballot by unctuous Senator John Briggs (Dennis O’Hare) to prohibit homosexuals from teaching in California schools in the context of Anita Bryant’s wider nationwide campaign to limit gay rights. (The only jarring scenes here involve a wheelchair-bound Minnesota boy who contacts Milk with thoughts of suicide—too calculated a dramatic ploy.)

Naturally the script also deals with Milk’s relationship with his eventual killer Dan White (Josh Brolin), the ostensibly straight-arrow but troubled ex-cop elected to the supervisors’ board whom Harvey initially befriends (believing, it appears, that he might be, as he tells his associates, “one of us”) but ultimately, in White’s eyes, betrays. It can’t entirely explain White, who remains a fairly opaque figure, but Brolin, who’s clearly riding a wave with “No Country for Old Men” and “W.,” beautifully suggests the torment and turbulence within the inarticulate man, who in his hands becomes something more than as cardboard villain—an important accomplishment that helps to keep Van Sant’s film from becoming, despite its obvious point of view, a simple-minded message movie. (Victor Garber doesn’t have nearly as much success with Mayor George Moscone, who’s here a fairly colorless politico.)

Even more important in that respect, though, is Penn’s deft, winning performance in the lead. He cannily embodies Milk’s essentially easygoing, sweet nature while also showing that beneath the agreeable exterior he was a deeply passionate man who could be a shrewd, calculating political operator. This is unmistakably a star turn, but an immensely vibrant and likable one, as impressive as his stunning performance in “Dead Man Walking,” though in a very different mode.

It would be remiss not to mention the work of production designer Bill Groom, art director Charley Beal, set designer Chad Owens, set decorator Barbara Munch and costume designer Danny Glicker, who make the period come alive without calling attention to themselves. Aided by the understated, gritty cinematography of Harris Savides, they recreate the era in so natural, unforced a fashion that the juxtaposition of new and archival footage is almost unnoticeable. Danny Elfman’s unobtrusive score is another asset.

There have been books written about Harvey Milk, a fine documentary (“The Times of Harvey Milk” by Rob Epstein), and even an opera (by Stewart Wallace). But Van Sant’s expertly crafted, invigorating film need play second fiddle to none of them. Even the lactose intolerant should get this “Milk,” and those who are intolerant in other ways would benefit from watching it, too.