Mel Gibson's interpersonal flaws have all but ruined his career. Now with the dark comic drama "The Beaver," Gibson delivers a career performance that salvages a flawed film.

Directed by longtime pal Jodie Foster, who also co-stars, "The Beaver" was shot in between Gibson's 2006 anti-Semitic rant during a drunken-driving arrest and his ugly breakup from ex-girlfriend Oksana Grigorieva, which resulted in his no-contest plea and three years on probation after he was accused of striking her last year.

Inevitably, because of the spectacle of Gibson's private life, it will be difficult for viewers to separate the real person from the fictional character in this tale of a suicidal man struggling with depression and inner demons.

"The Beaver" is an unorthodox therapy session for Gibson's Walter Black, a family man at the end of his rope who has a psychiatric break after finding a beaver hand puppet, a piece of cloth and fur that becomes an alter-ego helping him to work through his problems, at least initially.

As Walter and his beaver buddy delve deeper into the nature of depression, viewers likely will ponder whether Gibson was exploring his own dark emotional recesses at the same time.

Maybe, maybe not. Either way, Gibson creates a rich, engrossing portrait of a man in deep distress, playing Walter with great heart and humour where appropriate, and the rest of the time with the disturbing conviction of someone who's been there himself.

Gibson's performance makes the film generally work despite a story from first-time screenwriter Kyle Killen that veers from an absorbing family dynamic into a pointless media circus as Walter and his beaver puppet become national celebrities.

"The Beaver" would have been more effective without the tabloid trappings, if the story had been contained within the narrower and relatable confines of the Black family, which has been torn apart by Walter's depression.

So much so, that as the film opens, his wife, Meredith (Foster), is kicking him out of the house for the good of their two sons, angry 17-year-old Porter (Anton Yelchin) and 7-year-old Henry (Riley Thomas Stewart).

The head of a toy manufacturer he inherited from his uncle, Walter has been in the dumps so long that his household and his business are ready to crumble.

At a low-point when taking his life seems the only option, Walter stumbles on the beaver puppet, through which he begins to speak in a Cockney accent, demanding that others interact with the creature as his proxy.

The beaver speaks like a no-nonsense, working-class shrink, lifting Walter out of his funk, winning over Meredith and Henry, who are glad to have husband and father back in any form, and reviving the fortunes of the toy company.

Porter, clearly dealing with symptoms of potential depression inherited from his father, is the only one who doesn't buy into the beaver, viewing the puppet as a crass ploy for his dad to weasel his way back into the family.

Early on, Gibson yucks it up with charm and vigour as if the beaver were just that and the film were a lightweight comic fantasy about mental illness. "The Beaver" gradually digs much, much deeper as the beaver persona proves to be another symptom of the dark spaces in which Walter has lived much of his life.

It still winds up a mental-illness fantasy, with a forced ending and a convenient side story involving Porter's valedictorian classmate (Jennifer Lawrence) that's there to provide a broader view of family dysfunction.

As in her previous times behind the camera on "Little Man Tate" and "Home for the Holidays," Foster provides a precise, measured setting for the story then steps back and lets her actors perform.

Friends with Gibson since they co-starred in 1994's "Maverick," Foster is a sturdy but muted presence alongside Gibson, whose eyes bespeak a bottomless melancholy even as he works the puppet on his hand with a glib voice and maniacal movements.

Gibson makes the puppet feel like part of his own body and a frightening extension of Walter's subconscious. With the dusky corners Gibson has revealed of his own psyche, "The Beaver" is not only a showcase for a great performance, but also, an intriguing academic study of where Walter ends and Gibson begins.

No matter what he does, what acts of contrition Gibson undertakes, his career will never be the same. Some, perhaps many, in Hollywood will not want to work with him, but as long as friends like Foster stand by the guy, Gibson can find interesting work.

In smaller films than he once starred in, granted, but that happens to virtually all aging actors. With "The Beaver," Gibson shows that for all his personal turmoil, he still may have a career in the twilight years.

Three stars out of four.