James Gandolfini was on the verge of solidifying his reputation as one of TV’s all-time greatest actors. In the years since wolfing down onion rings in the enigmatic final scene of the “The Sopranos,” he had earned a Tony nomination for “God of Carnage” and aced the role of an amoral documentary filmmaker in “Cinema Verite.”

Still, stories of an unreliable nature, going AWOL on shooting days without so much as a text message, and his uneasy relationship with the press — interviewing him was as perilous and unpredictable as poking a sleepy bear with a microphone — were starting to overshadow his immense talent.

“The Night Of” was going to change all that. Gandolfini had pounced on the role of the miniseries’ moral center, John Stone, an ambulance-chasing lawyer with a grotesque foot condition and an equally ugly reputation in the New York City courts, and had wrapped his first scene with his on-screen client, a Pakistani-American college grad accused of stabbing a one-night stand in her Upper West side condo.

Then he died.

Three years later, the eight-part drama has been resurrected with John Turturro taking his longtime friend’s place. While the project has its shortcomings, too often painting outside the lines of a faithful portrait of the current legal system, it’s easy to see what Gandolfini was so passionate about.

It’s “Law & Order” for grad students.

Unlike that perennial series, “Night” doesn’t open with a murder — or any sort of chung-chung moment. The creators, novelist Richard Price (“Clockers”) and Steven Zaillian, the “Schindler’s List” scribe making his first foray into TV, take their own sweet time introducing us to Naz (Riz Ahmed), a wide-eyed college tutor who argues about basketball around the dinner table and exchanges small talk in Hindi at his mom’s clothing store.

One fateful evening, he borrows his father’s taxicab to attend a cool-kids party in Manhattan, inadvertently picking up a femme fatale in fishnet stockings along the way. After an evening of pill-popping and kinky sex, he awakens to find his date has been stabbed 22 times.

Is Naz guilty? Stone doesn’t know — or seem to care. He’s a case-sniffing runt with a business card that reads “No Fee, ’Til You’re Free” and he initially sees the case as a golden ticket.

But the unshaven, sandal-sporting attorney is savvier and more committed than he first appears, transforming into the young man’s greatest advocate against an army of overworked cops, casually prejudiced bureaucrats, ambitious prosecutors and manipulative cellmates.

Price, who does most of his research from the back seat of squad cars, sprinkles his scripts with brilliant insight: the unwritten rule that defendants should wear a white shirt in court. The humiliating proceedings a shaken parent endures when visiting the incarcerated at Rikers Island. A veteran detective methodically breaking down events leading up to the killing through credit card receipts, parking tickets and toll booth footage. A jury pool barely keeping its eyes open during videotaped instructions. A retiring cop going through the motions of a heartless farewell party.

It is in these moments that “Night” stands next to “The Wire,” TV’s greatest example of how to dramatize bureaucracy without making viewers want to jam a No. 2 pencil through their eardrum.

Thanks, De Niro

As in “The Wire,” the cast is jampacked with great performances from familiar and lesser known names. Glenne Headly makes the most out of role as a high-profile lawyer whose soft demeanor does little to mask her desire to lead the evening news. Bill Camp gives an Emmy-worthy performance as the charming lead detective, who, as another character describes him, is a really subtle beast.

And then there’s Turturro. You may have forgotten how well the actor channeled his maniacal energy in such classics as “Miller’s Crossing” and “Quiz Show.” I know I did. That oversight is corrected the moment he instructs Naz to keep his mouth shut and only builds as he slowly makes his case, all the while dealing with his itchy feet and an unlikely bonding with a cat he’s allergic to.

Hard to believe that Robert De Niro passed on the role after Gandolfini’s death.

Unfortunately, Price and Zaillian don’t put enough trust in Turturro’s little touches. About halfway through the series, Stone transforms into a Sam Spade, risking life and cracked-skin limbs to hunt down witnesses and intimidate other suspects. There was a point after the fourth hour that I thought he might skip the subway and hop into the Batmobile.

All in the game, yo

Other unnecessary attempts to goose the action creep into the proceedings, most notably at Rikers Island, where Naz is recruited by the cell block’s Godfather, “Wire” standout Michael Kenneth Williams. Yes, it’s always good to see Omar back in action, but the tacked-on story line seems more like padding than an otherwise harrowing examination of the penal system.

Another story line in which another one of Naz’s attorneys appears to be falling in love with him would make even Dick Wolf squirm.

Forgive the misdemeanors and focus on the knowing minutiae and stellar performances, both of which are enough to make “Night” another must-see program in what’s already been a banner year for television.

One more touching detail to note: The opening credits list Gandolfini as an executive producer.

The Big Man would have been proud. 

njustin@startribune.com

612-673-7431

Twitter: @nealjustin