The Night Of” may be Steven Zaillian’s first TV series, but the reality is it’s more like a nine-hour film. The Oscar-winning writer of “Schindler’s List” labored over every frame of the HBO limited series, from the scripts to the direction to the editing. The gripping eight-part murder mystery — which debuted July 10 and continues through Aug. 28 — grabbed hold of him, far more than he had expected.

“I couldn’t let go,” he says. “I just felt that I knew it inside and out.”

Along with writer Richard Price, Zaillian had planned to be hands-on only with the pilot. But once he delved into the production, he found he wasn’t willing to turn over the reins to another director.

“We both started to feel that the more we did, the more we wanted to do it all,” he says. “It’s a lot to keep in your head, and it’s a lot to expect another director to come in and know exactly where they are in the story, exactly what’s been done before, and exactly what’s going to be done later. I honestly don’t know how people do it any other way and keep that kind of focus and consistency.”

Peter Bohler for Variety

He ended up directing all episodes but one. But it took a bit of convincing, he concedes, for HBO to agree to turn over the series to him. “It was a process,” acknowledges Kary Antholis, HBO’s head of miniseries. “But at the end of the day, Steve had such a clear idea of what he wanted that, in retrospect, it feels natural.”

The result is an auteur’s vision that’s been winning stellar reviews — and has restored luster to HBO’s reputation as a home for prestige drama. “The Night Of” follows Naz (Riz Ahmed, from “Nightcrawler”), a Pakistani-American college student who borrows his father’s cab for a night of partying in Manhattan. But his life quickly unravels when he wakes up to find the girl he’s been with has been stabbed to death. Suddenly a murder suspect, he gets caught up in the vagaries of the criminal justice system, while his beleaguered defense attorney, John Stone (John Turturro), labors to exonerate him.

For Zaillian, “The Night Of” was a passion project more than seven years in the making, as the series lumbered through HBO’s development cycle.

“Most people think we had a period where we weren’t sure if we were going to do it or not,” he says, “but the truth is we were working during that period as well.”

It was 2009 when then-BBC Worldwide television executive Jane Tranter showed Zaillian a British TV series called “Criminal Justice.” The two enlisted Price to adapt it, and brought it to HBO to make the pilot. James Gandolfini signed on to star as the defense attorney, as well as to serve as an executive producer. But he died suddenly of a heart attack in June 2013, shortly after the series was greenlit. “It was harder just on a personal level,” Zaillian says. “He was a colleague and a friend.”

Robert De Niro was attached briefly as a replacement but couldn’t commit to the lengthy shooting schedule. “It wasn’t even close,” says Zaillian. And then Turturro’s name came up. “He doesn’t do television any more than I do,” says Zaillian. “It was just kind of lucky that we both see where things are going [with film], and the kinds of things that I think both of us like to do are being done more on television.”

The other key creative choice was casting Ahmed. In the British version, his character is Caucasian. Although the change was made for reasons of verisimilitude — New York cab drivers are rarely white — it opened up rich avenues of storytelling about prejudice in a post-9/11 world. “That one little decision — it’s actually a very big decision, but it didn’t seem like it at the time,” says Zaillian. “It informs almost every part of the story.”

“What I was trying to do was make a fictional film but do it in a very realistic way.”
Steven Zaillian

As Naz’s case unfolds and he’s sent to Riker’s Island, it’s not hard to imagine what fate befalls him. The series takes an unflinching look at the criminal justice system, and Zaillian and his team conducted painstaking research throughout every level of the process. “Your average person, all they know is maybe what they see on TV. But to actually go into the tombs — to go to Rikers and to go to arraignment court — it’s something you never could imagine,” he says.  “You don’t want to get arrested, let me put it that way.”

The series also spends ample time exploring the Pakistani-American community in Queens and the fallout for Naz’s family members as they struggle to defend themselves within the media spotlight. Zaillian says his goal was to present events in a straightforward manner, without attempting to send a broader message.

“What I was trying to do was make a fictional film but do it in a very realistic way; and not to have the usual kind of things in it that you think you need, like heroes and villains,” he says. “All the characters basically are pretty good. They’re just doing their job the best that they can. This is how the story unfolds when everybody is just doing what they do.”

Ahmed — who’s filming the Star Wars movie “Rogue One”  — also sees the story as a nuanced narrative. “It’s just very unflinchingly authentic, very uncompromising in its authenticity,” he says. “A lot of people talk about the wider themes of it, whether it’s the criminal justice system or Islamophobia. But I have to say I think that the intention of the writers is to just tell a compelling story.”

The shoot took 10 months, filmed in or around New York City, nearly all of it on location — even down to the insert shots. It’s an undeniable homage to films of the ’70s, like those of Sidney Lumet — Zaillian calls it “gritty New York.” He says he was also inspired by the 2004 true-crime documentary “The Staircase,” as well as the Maysles brothers’ 1968 film “Salesman.”

The pace of the storytelling is leisurely. In the first episode, we spend more than 10 minutes with Naz at the police station, where we know he’s carrying a piece of crucial evidence the detectives have yet to find. The knowledge is excruciating.

Making a Murderer: Riz Ahmed (below, with the director) calls the shoot one of the most challenging he’s ever done. Courtesy of HBOT

“I loved that about it, that it has that kind of pace,” says Zaillian. “The rest of the show has that kind of thing happen from time to time, too, where you feel the anxiety of something because it’s taking a while to happen.”

That’s a luxury that television allows, he says, but film often doesn’t. Over the course of the series, we’re able to spend time with the key characters, learning about Stone’s battle with eczema or Naz’s father’s struggle to regain his cab.

“I don’t want to know everything about these characters in the first 10 minutes; I don’t want to know anything about them in the first 10 minutes,” says Zaillian. “I want to know who they are by the time I get to the end, and that they’re a lot more complicated than it seemed.”

Indeed, this is not just another procedural; the filmmaker admits he’s never seen an episode of “Law & Order.”

“The fact that Steve’s gone through three decades without seeing a ‘Law & Order’ is a small miracle,” says Antholis. “But then you begin to understand why he’s able to capture it and make it feel fresh — his attention to the detail of how the system interacts with human beings to create these functions that are sometimes tragic and sometimes really funny.”

Once production wrapped, Zaillian spent a year editing the series, and any qualms HBO may have had were quickly allayed. “I’ve rarely seen a more accomplished director’s cut with temp music and sound design,” Antholis says. “Very, very sophisticated, and kind of a testament to the efficiency of his shooting.”

While Zaillian says he enjoyed the experience, he’s not ready to commit to a sequel. “I don’t know that I could spend five, six years on another one,” he notes. “The reason I’ve directed so few films is because I have to live with it for a year and a half of writing it. The same thing is true with television, only multiply it by two.”

But he promises that — unlike AMC’s “The Killing” — there will be resolution at the end of “The Night Of,” even if he didn’t necessarily know what it would be when he started out. “We let the writing take a natural course,” he says. “There weren’t a lot of preconceived ideas about exactly what was going to happen to whom. It was important to me that whatever happened, it was just going to change all of these characters in some way.”

Including him.