James Gandolfini, who has died aged 51 of a heart attack, was one of those rare actors who was able to portray a violent, bullying, murderous, vulgar, serial adulterer, while simultaneously eliciting sympathy and understanding from television audiences. In 86 episodes from 1999 to 2007, in HBO's hit series The Sopranos, the balding, beefy, middle-aged Gandolfini, as Tony Soprano, a New Jersey mafia boss, managed to transcend any stereotyping of Italian-Americans (although the charge was still made) by showing the flawed character's vulnerable side.

While Tony Soprano does embody the close-knit Italian-American community, with its codes of masculinity, Gandolfini, who had studied the Sanford Meisner method of acting for two years, lived up to Meisner's exhortation to "find in yourself those human things which are universal". Gandolfini always claimed to be nothing like Tony Soprano: "I'm really basically just like a 260-pound Woody Allen."

Gandolfini explained that he sometimes went to extremes to express Tony's anger by hitting himself on the head or staying up all night to evoke the desired reaction. "If you are tired, every single thing that somebody does makes you mad. Or I just walked around with a stone in my shoe. It's silly, but it works."

Yet it was the scenes of the therapy sessions with his psychiatrist Jennifer Melfi (Lorraine Bracco) that really humanised the character. "If you took the Melfi scenes away, you wouldn't care about this man as much, or care about anything that was happening to him," Gandolfini explained.

Like his television alter ego, Gandolfini was born, raised and educated in New Jersey. His mother was a school dinner lady, and his father a bricklayer and stonemason. Both his parents were devout Roman Catholics of Italian ancestry and spoke Italian at home. After graduating from Park Ridge high school, Gandolfini gained a BA in communication studies at Rutgers University.

After the role of one of the poker- playing buddies of Stanley Kowalski (Alec Baldwin) in a revival of A Streetcar Named Desire on Broadway in 1992 – in which he had the last line of the play, "The game is seven card stud" – Gandolfini started to get roles in movies, first making an impression in Tony Scott's True Romance (1993), which understandably got him an audition for the leading part in The Sopranos. In a memorable stomach-churning scene, as a ruthless hitman he beats up Patricia Arquette, only to have her whack him on the head and set him on fire.

Gandolfini was then cast against type as shy guys in Mr Wonderful (1993) and Angie (1994), but returned to bad ways as an ex-KGB man in Terminal Velocity (1994), as a southern-accented stunt man turned bodyguard in Get Shorty (1995), as a corrupt cop who kills himself in Sidney Lumet's Night Falls on Manhattan (1996) and a mafia man in The Juror (1996). Of the last, Roger Ebert wrote: "Gandolfini has a very tricky role, who is about as sympathetic as a man can be who would, after all, kill you. His line readings during a couple of complicated scenes are right on the money. If the movie had been pitched at the level of sophistication and complexity that his character represents, it would have been a lot better."

Gandolfini portrayed all his roles admirably, but there was no inkling that he would ever be anything more than a serviceable heavy in mainly commercial thrillers for the rest of his career. It was television and Tony Soprano that gained him Emmy awards, three years running, and superstar status, which he never equalled but which sustained his active post-Sopranos life. This included In the Loop (2009), The Taking of Pelham 123 (2009) and Welcome to The Rileys (2010), in all of which he attempted successfully to soften his persona.

In 2007, Gandolfini produced a documentary, Alive Day Memories: Home from Iraq, in which he interviewed 10 injured Iraq war veterans. This was followed by Wartorn (2010), about post-traumatic stress disorder and its impact on soldiers and families through several wars in American history.

His first marriage, to Marcella Wudarski, ended in divorce. He is survived by his second wife, Deborah Lin, and their daughter, a son from his first marriage and two sisters.

• James Joseph Gandolfini, actor, born 18 September 1961; died 19 June 2013