Clint Eastwood's "J. Edgar" starts with a bang worthy of a Dirty Harry movie. Then it turns as ambiguous and challenging as "Unforgiven" or "Letters From Iwo Jima." This far-from-perfect film is hobbled by uneven performances and a script studded with historical bullet points. But it's a strong tribute to Eastwood's personal vision. What other superstar risks his commercial standing so often to create movies indifferent to the bidding of the box office?

In the bravura opening sequence, an anarchist bomb rocks the home of Woodrow Wilson's Attorney General, A. Mitchell Palmer. Palmer, retaliating forcefully, places Hoover, a methodical young Justice Department lawyer, in charge of a coordinated effort to gather intelligence about those responsible. Hoover organizes raids on thousands of suspected anarchists, arresting many simply for their radical ideas.

Rebuked for his overzealous actions, Palmer left public life the following year. Hoover stayed in power for half a century. As director of the FBI, he became one of the most admired and feared figures in U.S. government, protecting the nation while subverting its constitutional freedoms and sabotaging the civil rights movement.

"J. Edgar" offers a portrait of the man in full, giving Leonardo DiCaprio his most challenging and fully realized role. Hoover was a contradictory figure who amassed blackmail-worthy material about his opponents' extramarital affairs while shrouding the nature of his deep relationship with his right-hand man and life partner, Clyde Tolson (Armie Hammer). He acted out of high idealism and base egotism. He sought attention but rejected scrutiny.

Whether he's playing Edgar the eager, keyed-up rising star or the exhausted, hollow-eyed old man, DiCaprio is pitch-perfect. Once you're past the shock of seeing him in old- age makeup, you never have to suspend disbelief.

In an early scene, young Edgar takes office typist Helen Gandy (Naomi Watts) on an awkward first date. They visit the hushed, gloomy Library of Congress, where he has devised a filing system organizing the holdings. Bursting with pride, he asks her to imagine files on every U.S. citizen. Then, in a hilariously gauche move, he bluntly proposes. Sensing that knowledge and power are this man's aphrodisiacs, she declines but remains his secretary and confidante. Throughout the film, Hoover steps into the harsh, bleaching light then retreats into murk.

The screenplay, by "Milk" Oscar winner Dustin Lance Black, is a hectic affair, shuttling between the mid-1960s and the early days of Hoover's career. It's more a personal story than a political one; the scope of the national police force that Hoover created rarely registers. His kingdom seems to consist of an imposing office and a few men in fedoras.

His private life is richly rendered, however. Judi Dench dominates every scene as Annie Hoover, a controlling matriarch with a perpetual hard stare. She seems to tap into a deep strain of masochism in her son, clasping him to her bosom and teaching him to do a stiff fox trot, then bullying him with stories of a schoolboy who committed suicide after being exposed as a cross-dresser. Not since "Psycho" has a boy been so conflicted about his mother.

The other costars make a fleeting impression (Watts is wasted in her underwritten role) or a poor one (Hammer is fine as the flirtatious young Tolson but disastrous once he affects a layer of latex aging makeup and a palsied walk).

"J. Edgar" functions best as a platform for DiCaprio, who captures Hoover's squat, heavy physicality, his rapid-fire radio announcer style of speech and above all his tightly repressed inner turmoil.

The film suggests that Hoover's campaign against what he considered the moral chaos of modern American life was yet another case of a man in power decrying the very behavior that represents his own insecurities. DiCaprio's performance gives us the tragedy of a man at war with himself.