Eddie Haskell was a sneaky little rat, a two-faced suck-up and a tinpot bully. A punk who stirred up trouble.

We loved him for it.

The brilliance of Eddie — an indelible character for baby boomers in their youth, thanks to endless black-and-white re-reruns of the foundational sitcom “Leave It to Beaver” — lay in the way he differed from virtually any other child or teen characters on TV: He was a bad kid, with little effort made to redeem or rehabilitate him.

Ingeniously portrayed by the actor Ken Osmond, who died Monday at the age of 76, Eddie was as much a metaphor as a supporting character on a gentle family series. He embodied the kind of personality that children first encounter on the playground but then again throughout adulthood: the obsequious work colleague, the backstabbing boyfriend, the smarmy politician. Real life has a lot of Eddie Haskells.

When Eddie was born, TV had no box for him, certainly not on a wholesome show aimed at the children of wholesome American families. The good guys on TV sitcoms were the cardigan-wearing dads and pearl-clad moms — Robert Young on “Father Knows Best,” Danny Thomas, Andy Griffith, Donna Reed, Ozzie and Harriet Nelson — who cajoled and counseled their wayward offspring back onto the straight and narrow, all within about 25 minutes. The kids were never mean or bad; they were just a little ... confused.

Osmond’s Eddie was an antihero, singular because he was subversive — Bart Simpson long before “The Simpsons” were born. On every episode of “Beaver,” he could be counted on to instigate a scheme that would invariably land Wally or the Beav in hot water, like the time he persuaded Wally to play a practical joke on Lumpy by hitching a chain wrapped around a tree to the rear axle of Lumpy’s car. The mildly disastrous consequences of Eddie’s devilry predictably set up the big moment at the end of the show in which Ward or June Cleaver would distill an important Life Lesson from the experience.

Ward (Hugh Beaumont) and June (Barbara Billingsley) always seemed to have Eddie’s number. (In one episode, Eddie tells Wally that he thinks Ward would be “happier to see Khrushchev standing there” when Eddie comes by for a visit.) They saw through his limited bag of tricks — the flattery (“That’s a lovely dress you’re wearing today, Mrs. Cleaver”) and the faux formality (“Are Wallace and Theodore at home today?”).

The wonder of it — the alluring thing to wannabe mischief-makers everywhere — was that Eddie usually got away with it. No one ever really called out his nonsense in anything but the gentlest terms. Wally (Tony Dow) remained his best friend despite his evil ways and his constant tormenting of Beaver (Jerry Mathers). Perhaps Wally saw in Eddie his suppressed rebellion and own dark nature?

Even more curious is why Ward and June, otherwise so attentive and conscientious in raising their boys, never warned them away from Eddie. Was there ever a scene in which Eddie was banned from the Cleaver household, or Ward laid down the law about Wally hanging around with that rotten kid?

“Leave It to Beaver” also never really spelled out the details of Eddie’s home life, but in hindsight it’s possible to glimpse the damaged teenager behind the lovable rogue. You wonder: Was he a jerk because he was hurting? Did he admire Wally because he could never be as popular or as cool or as loved as Wally? What kind of kid says things like this: “If you can make the other guy feel like a goon first, then you didn’t feel so much like a goon.” And what kind of adult does he become?

In real life, Osmond’s life took a very different path than the one his epic TV creation seemed to be headed down. Unable to find work as an actor after being typecast as Eddie, he became a motorcycle officer for the Los Angeles Police Department, the very embodiment of law and order. He served on the force for 13 years, retiring in 1983 after being shot three times by a suspected car thief.

Osmond later reprised his role as Eddie Haskell in TV movies and a Disney Channel sequel of his old show, “The New Leave It to Beaver,” which reassembled many of his old castmates. Eddie had grown up to become a shady contractor, which felt just right.

It’s perhaps not surprising, given Eddie’s nearly mythic stature among boomers, that certain urban legends trailed Osmond. One was that the actor who played Eddie grew up to become Alice Cooper, the ’70s rock star (the fallacy grew after Cooper told an interviewer that he had been like Eddie Haskell as a kid); another was that he grew up to become ’70s porn star John Holmes (who starred in several adult films billed as Eddie Haskell until Osmond sued).

Osmond confessed to interviewers later that he resented the stolen glory. And well he might. So few characters have echoed down through the decades as the one he created. The jerk endures.