Welcome to the funniest comedy of 2012. Loony, lewd and lovable, "Ted" takes place on a stratospheric plane of preposterousness. Underachiever John Bennett (Mark Wahlberg) made a childhood wish that his teddy bear would come to life and be his best friend forever. It came true. Ted was a media sensation, but after his flurry of fame, our celebrity-glutted society shrugged him off. Twenty-five years later John and Ted are affable couch spuds, living a juvenile getting-by life, cracking politically incorrect jokes and idling away their days with beer, bong and TV. Whoever said there are only 10 basic plots overlooked this one.

If this surreal take on the man-child and idiot-friend genres sounds cartoonish, it's to be expected. This is the first film from Seth MacFarlane, creator of the animated "Family Guy" series. Once we buy the abracadabra premise (set up in a prologue narrated by syrupy, faux-sincere Patrick Stewart), "Ted" respects plausibility and character integrity. It performs the essential magic act required of successful entertainment: getting us to identify with the people onscreen even as they behave absurdly. And good gravy, is this film ridiculous.

Like MacFarlane's TV hit, "Ted" presents the tribulations of daily life for a bizarre New England family. As Lori, John's successful, supportive girlfriend, Mila Kunis struggles to preserve a semblance of normality in their home life. It's not easy. The script is a free-form barrage of gross-out gags, odd celebrity cameos and curveball jokes. It feels more stuck together with a glue gun than written, but the sheer foulmouthed energy of the enterprise is irresistible. As Ted is eased out of John's life and into his own apartment, John's loyalties remain divided.

Even when the gags aren't brilliant, you're aghast at how far off the wall Wahlberg and company are willing to take them. There are feverishly inappropriate jokes here that will live on in dorm-room bull sessions forever. When skirt-chasing Ted lands a job as a grocery clerk, he and a busty co-worker make the stockroom their love nest. You may never look at parsnips again without snickering.

The film features a hamper full of sharply defined characters, from Lori's predatory popinjay boss (Joel McHale) to the psycho creep who wants Ted for his own little boy (Giovanni Ribisi). Kunis is sweet and demure though understandably impatient with her Peter Pan boyfriend, and Wahlberg brings everydude charm and real tenderness to their romantic scenes. He even sends up his Marky Mark days with a tone-deaf romantic solo that sparks a mini-riot at a Norah Jones concert.

Most remarkable of all is Ted himself (voiced by MacFarlane), the greatest comedic stuffed animal since "Caddyshack's" gopher. When the lifelong friends' relationship hits bottom, John angrily calls Ted "Teddy Ruxpin." The insult sparks a raucous, room-wrecking brawl that goes on and on past any rational bounds, and ends in such a frenzy of ferocity that laughter is the only release valve. Not everything works -- the momentum drops in the sentimental final chapter -- but there is more than enough here to keep audiences howling with laughter and hoping for a sequel.

Colin Covert • 612-673-7186