Guilt and redemption, or the lack of it, have been linchpins of Martin Scorsese's work since his earliest films. They form the core of The Departed, an adaptation of the 2002 Hong Kong hit Infernal Affairs. Transported to Boston, the story still concerns a battle between a gangster and the police who are trying to put him away. It's a meatier film than Scorsese's last few efforts, but what was a crisply plotted cop thriller has turned into a sprawling melodrama dominated by an unrestrained performance from Jack Nicholson.

Nicholson plays Frank Costello, a gang leader who trains Colin Sullivan (Matt Damon) to be his own personal mole in the police department. At the same time, two police officers (Martin Sheen and an amusingly foulmouthed Mark Wahlberg) place Billy Costigan (Leonardo DiCaprio), their own undercover cop, in Costello's gang. As the cops and the FBI (represented by Alec Baldwin in a quick-witted and dead-on turn) close in on Costello, he relies on Sullivan to tip him off about their plans. Having gained Costello's trust, Costigan realizes that the gangster is using a police mole. At the same time, Sullivan discovers that there in an informer on Costello's crew. Both men have to ferret out their counterparts while protecting their own identities.

You would expect Scorsese and his longtime cinematographer Michael Ballhaus to capture Costello's gangster milieu accurately, and the opening hour of The Departed presents a world as convincingly fetid and claustrophobic as in any of the director's films. Working again with editor Thelma Schoonmaker, Scorsese has developed a sort of free-association editing scheme in which the focus of the film shifts seamlessly among any of a half-dozen characters. It gives a seductive power to The Departed's visuals, a power that is occasionally undercut by an over-insistent score.

DiCaprio and Damon are both persuasive in their roles, but Vera Farmiga as a concerned police psychiatrist and Ray Winstone as Costello's hatchet man turn in the most grounded and affecting performances. Nicholson, on the other hand, can't resist overacting. Making rat faces, crooning Irish folk ballads, brandishing a prosthetic penis, he mocks the material, reducing it to an inside joke. Played straight, his role would have been far more chilling; instead, he derails a plot that depends on a clockwork precision.

If you haven't seen Infernal Affairs, you may find the complex storyline of mirrored actions and twinned destinies in The Departed satisfying. But there's no good reason why so much of the film generates so little suspense. Scorsese may not have trusted the material, pumping up the smallest transition scenes with jump cuts and other devices. But even his fans will have to admit that the film's big set-pieces-a compromised stakeout during a drug deal, or a chase from a porn theatre through Chinatown-fall flat. The Departed is as much a series of missed opportunities as it is a return to form for the director. Plushly mounted but marred by fussy choices and overacting, it strands Scorsese once again at a crossroads between art and commerce.