The true crime story is a staple of TV and publishing but only rarely inspires movies. How lucky we are that Richard Linklater bucked that trend to make "Bernie," a one-of-a-kind comedy based on the real homicide of an innocent old lady.

The prolific director of "Dazed and Confused," "Before Sunrise" and "School of Rock" has earned a reputation for wit, skill at gracefully moving a story along, and constantly surprising viewers through unexpected narrative choices.

With terrific performances from Jack Black, Shirley Mac-Laine and Matthew McConaughey, Linklater has created a loopy nonfiction marvel that challenges the boundaries of "what's funny." The characters are not likable, but my stars, they are alive. It's like "In Cold Blood" written by Flannery O'Connor instead of Truman Capote.

Black does the most restrained and human-scaled work of his career as Bernie Tiede, a prim, gentle East Texas mortician. The film opens with Bernie teaching cadaver cosmetics. He applies super glue to a corpse's lips in preparation for open-casket viewing. "Even the slightest hint of teeth can be disastrous," he cautions his students. "You cannot have grief tragically becoming comedy." That's precisely the strain of Southern Gothic humor "Bernie" achieves. Alternately merry and morbid, it charts the outlandish relationship between the most loved man and the most hated woman in Carthage, Texas.

Bernie's a pillar of his small town, a good Samaritan and confirmed bachelor. A star of the church choir and community musicals, Bernie sings silver-throated hymns at funerals and takes care to console mourners. Then Bernie endears himself to Marjorie Nugent, the richest, meanest woman in town. MacLaine is cold, marble-hard and hilarious as the evil-tempered old dragon, making the tinge of romance about their alliance all the more repugnant. Cutting her relations out of her will, she directs her entire estate to her new traveling companion and business manager.

But Bernie's meal ticket carries a high cost. The possessive, domineering Marjorie makes his life unbearable, and in a spasm of temporary insanity, Bernie plugs her four times in the back, stuffs her body in a freezer and tells everyone she's on an extended trip. Hot-dog district attorney Danny Buck Davidson (McConaughey, acting with appealing comic looseness) jumps on the case, only to find that none of the townfolk want to convict.

The Austin-based Linklater shoots on real locations, using Carthage and hiring locals as extras. His camera hovers in an almost miraculous fusion of proximity and comic distance. He shoots semi-documentary scenes with a chorus of coffee-shop and front-porch chatterers bluntly commenting on the case. "It wasn't as bad as everyone said it was," reasons one. "He only shot her four times, not five."

"Bernie" is layered with stranger-than-fiction comic touches. Black does an outstanding performance as Prof. Henry Hill in a community theater run-through of "76 Trombones" not long after the murder. It's oddly funny how he could de-couple his private and public lives, and it's also a perfect role for the Pied Piper who wins over a little town with his talent and charisma.

The question remains, who wants to see a comedy based on a real murder? But "Bernie" is delightfully offbeat, wickedly good and well worth investigating.