When you're 5, an imaginary friend can be a fantastic thing. When you're 30, it should be disturbing. But FX's strange, twisted, at times hilarious new comedy "Wilfred" (which debuts tonight at 10) suggests that for some adults, imaginary friends are the best kind of all.

We first meet Ryan (Elijah Wood) as he's at the end of his rope - or wants to create the illusion that he is. He's working on the third draft of his suicide note, but he insists on mixing up the vial of pills into a smoothie that includes a vitamin supplement, so at least a part of him still has a foot in the land of the living. The suicide attempt doesn't work out, and then his pretty new neighbor Jenna (Fiona Gubelmann) turns up on his doorstep asking if he can do her a favor and babysit her dog Wilfred...

...only to Ryan, Wilfred isn't a dog, but rather a rough-looking Australian man in a dog suit who swaggers into Ryan's house, asks if he has any DVD's - "I like Matt Damon," he says, deadpan - and proceeds to take over Ryan's life. Though he frequently seems menacing, his goal apparently is to teach Ryan how to act like a man by first teaching him how to act like a dog.

Wilfred's played by Jason Gann, who co-created and starred in the original Australian version of the series. He's been playing the character for years and wears him like a second skin. What's brilliant about Wilfred is that he's both a man and a dog in equal measure. He has many of the same fears and fixations as an actual canine (he is, unsurprisingly, obsessed with rear ends of all species and sizes), but can express them eloquently and/or angrily. He digs holes when he's nervous, but uses a shovel. Not long after Jenna leaves for work, he convinces himself she's never coming home, and when Ryan tries to reassure him, Wilfred gets indignant and asks, "Are you talking down to me?"

It's in that intersection of man and canine where "Wilfred" is at its strongest. The American version was adapted by "Family Guy" alum David Zuckerman, and there are times when Zuckerman and his writers assume that any behavior by an Australian man in a dog suit is inherently funny. (The second episode, despite revolving around Wilfred's hatred of going to the vet, is the weakest of the three I've seen for that reason.) But when Wilfred is applying dog logic to human problems, the series can be both very funny and an oddly sweet show about male friendship. (Or, at least, as sweet as any show with this many possum anus jokes can be.)

Whether as a child star or a hobbit, Wood's on-screen persona has always been defined by those wide, ridiculously blue eyes of his. Here, he and they are put to good use responding with horror and confusion to Wilfred's shenanigans. Though Ryan's usually in disbelief at what he's seeing - and what no one else is (like the attractive women who are only mildly put out by Wilfred pawing at or licking them) - the chemistry between Wood and Gann helps sell this bizarre relationship as something real, and solid footing for the future.

"Wilfred" exists in an interesting middle ground on the FX comedy continuum. It's not nearly as laugh-out-loud funny as "Always Sunny" and the second season of "The League." (The first episode is by far the funniest, and after that the novelty of Wilfred himself goes away just enough that it's more clever than hilarious.) And while it's dark, it's certainly not as serious as "Louie" often gets. But it fits the channel's larger brand (in both comedy and drama) about men existing on the edges of acceptable human behavior. Ryan's a miserable, depressed person, and he needs something to knock him out of his rut. And if that means becoming best friends with the human-looking dog next door - and frequently inhaling from Wilfred's bong - then who's to say that's a bad thing?

Alan Sepinwall may be reached at sepinwall@hitfix.com