Steven Bochco, who died this weekend at 74, had an amazing run of primetime success, creating three of television’s greatest hour-long dramas (“Hill Street Blues,” “LA Law,” and “NYPD Blue”) that stayed on the air a combined 25 seasons (1981-2005). I can’t think of another TV producer who comes close. Norman Lear may have ruled the 1970s, but by the 1980s, his impact had ebbed. Shonda Rimes is still going strong, but her streak started in 2005, so that’s only 13 years thus far. Okay, you have to give it up for “The Simpsons,” which is in its 29th season, and tip your hat to Dick Wolf, whose original “Law and Order” ran 20 years and spawned spinoffs like “SVU,” which is in its 19th season. But Bochco did it with three entirely new entities, each of which redefined Must See TV.

While Bochco had his failures — “Cop Rock” being perhaps the most notorious — it was those three landmark dramas that earned him status as a TV Legend. I remember being hooked by the first episode of each show, and staying with them long past the time when their quality began to suffer, as all long-running shows eventually do. I even remember the broadcast of the Emmy Awards after the first season of “Hill Street Blues,” which was struggling with very low ratings. NBC, which had given the show an unlikely renewal for a second season, had its promotions team working during the awards telecast to produce updated live promos congratulating “HSB” on each of its wins — a remarkable sweep in every acting category, as well as for writing, directing, and Best Drama. In the succeeding years, it continued to earn praise from its peers, with 98 Emmys nominations and 20 wins. Add to that 84 nominations and 20 wins for “NYPD Blue,” plus 89 nominations and 15 wins for “LA Law,” and pretty soon you need an entire room to hold the hardware Bochco’s creations collected.

In 2016, Bochco wrote a memoir, “Truth Is A Total Defense,” which touched on both the high points and low points of his career in TV. In the chapter on “NYPD Blue,” he did not shy away from the trouble he had with David Caruso, who played Detective John Kelly opposite Dennis Franz’s Andy Sipowicz. Bochco’s partner, David Milch had urged him not to hire Caruso because he’d be nothing but trouble. As the season went along, Milch’s prediction turned out to be true (Bochco referred to Caruso as “a cancer”), but it wasn’t until they were prepping for the second season that things went from bad to worse:

About a month into the summer hiatus, David Milch and I were already working on second-season scripts when Caruso’s agent called. Caruso wanted to be let out of his contract. Of course I said no and that if he decided not to show up for work, we would sue his ass. In that case, said the agent, could we all sit down and talk about restructuring his deal? In attendance were Caruso’s lawyer, his agent, his manager, me and, of course, Dayna. The meeting started with Caruso’s agent saying that Caruso had felt persecuted all year and that he felt Milch had reduced the size of his role out of personal animus. He again asked that we let Caruso out of his contract. Dayna, in no uncertain terms, asked what were they looking for on Caruso’s behalf. Caruso’s lawyer, with a straight face, said that their demands were based on the theory of diminished opportunity. Huh? Diminished opportunity, explained the lawyer, rested on the fact that Caruso was currently in New York working on a movie, making $75,000 a week. Returning to “NYPD Blue” for a second season at his contractual rate of $40,000 or so represented a big pay cut — hence the concept of diminished opportunity. I pointed out that if it weren’t for “NYPD Blue,” Caruso would be in New York for the summer working in a car wash. Dayna saw the red creeping up my neck. She tried to steer the meeting back on course. “What exactly are you looking for?” Caruso’s lawyer ticked off the following: One, $100,000 per episode. Two, Fridays off. Three, a 38-foot trailer. Four, an office suite on the lot, replete with his own development executive, for whom we had to foot the bill to the tune of $1,000 a week. Five, two hotel suites in New York when the company went there on location, plus a dozen first-class plane tickets. And lastly, Caruso had to have additional security to shield him from his adoring public. I said, “You’ve got to be kidding me.” Now the lawyer said, “Well, if you’re not willing to meet those demands, here’s a second set of demands Caruso could live with.” And he went on to ask for $65,000 an episode, Fridays off, the office suite, the development executive, the hotel suites, the plane tickets and, lastly — and here’s the kicker — Caruso wanted the last seven weeks of the season off, so that his window for doing feature films would be larger.

I’d had it. “Your client is under contract, we’ve exercised his option for a second year at $42,500 an episode, and if he doesn’t show up for work on the first day of shooting, we will sue his ass for everything he has.” And I walked out. As declarations of war went, that had gone well. The lawyer, the agent and the manager kept up a daily barrage. Ted Harbert, then an executive under Bob Iger, tried to meet with Caruso to talk him into returning. It was getting ugly. By now, we had four scripts written that, without Caruso, would have to be thrown in the trash. I finally decided to let Caruso go, but first I tracked down Jimmy Smits, who had been my first choice for the role when we were originally casting the show but who turned us down in favor of pursuing a film career. Jimmy was at the time somewhere in Morocco, shooting one of those sword-and-sandal epics. When I finally tracked him down — I think the nearest phone was 10 miles away, and he probably had to hitch a ride on a camel to get to it — I offered him the role again. Actually, I begged him. “Do you want to come home and be a huge TV star in a show that’s already a hit or do you want to be making movies in Morocco in 100-degree weather wearing a leather skirt?” Jimmy’s no fool. He came home and took over Caruso’s role in “NYPD Blue” and made the series even greater.

We then negotiated a deal with Caruso that, in exchange for his release, required him to do the first four episodes so that we could properly write his character out of the show and further stipulated that he couldn’t work on another television series for five years. Caruso was officially gone. When he had shot his last scene of the fourth episode, he turned without a word and left the set, the stage and the lot. He didn’t say a single word of thanks or a goodbye to his castmates — nothing.

In the meantime, Milch and I had to invent a whole new character for Jimmy Smits, which we did on the fly. It was a bit of a fire drill, but Jimmy — a consummate pro and a truly fine person — jumped into a fast-moving river and hung on for the remainder of that second season. The audience loved him, and by the end of the second season, we were an even bigger hit, ABC was thrilled, and no one missed David Caruso, whose so-called movie career was already circling the drain. Boo hoo.

The mark of a great TV producer is being able to turn a mistake like Caruso into something even better in Smits, a talent at which Bochco proved his worth time and time again over more than a quarter of a century. As a viewer, I didn’t care about the behind-the-scenes drama because I was too enraptured by the stories he presented week in and week out on my TV screen. Do it once, you’re good. Do it twice, you’re great. Do it three times, you’re a TV legend.

Read an extended excerpt from Bochco’s memoir here.