Why does ‘The Night Of’ list the late James Gandolfini as an executive producer?

Fans of HBO’s latest drama “The Night Of” might have noticed something odd in the credits — the late James Gandolfini is listed as an executive producer despite the fact that he passed away suddenly of a heart attack at the age of 51 in June 2013.

If you’re wondering why the late star has producing credits on “The Night Of,” it’s because the series, based on a U.K. television program called “Criminal Justice,” was a passion project of Gandolfini’s that he was set to produce and star in before his untimely death.

RELATED: Hollywood reacts to James Gandolfini’s death

HBO initially passed on the project, but eventually gave it a limited series order. Gandolfini filmed the pilot in late 2012, then HBO picked it up just a month before Gandolfini died. After his death, HBO and the producers decided to move ahead with the project and credit Gandolfini as an executive producer.

John Turturro eventually replaced the late actor in the role of attorney John Stone, who is defending Pakistani-American college student Nasir Khan (Riz Ahmed), accused of murdering a girl on New York’s Upper West Side.

Producers Jane Tranter and Steven Zaillian recently told The Hollywood Reporter about Gandolfini’s version of Stone and that Turturro worked hard to make the character his own.

RELATED: If you like ‘The Night Of,’ try these other TV crime dramas

“Jim had a very clear idea of how he would play Stone. It was very physical. A really, very sort of physical relationship with the character and how he wanted to play it,” says Tranter. “He talked about it very much in terms of the physique.”

“[Gandolfini] very much wanted to do it and I wanted him to do it,” says Zaillian. “But as much as I would have loved to have done it with Jim, this has really become John’s part. They’re both great actors.”

“The Night Of” airs Sundays at 9 p.m. ET/PT on HBO.