NBC’s “Law & Order: SVU” has reached its 400th episode — a milestone celebrated by just a handful of TV shows in the medium’s 70-year history.

Wednesday night’s landmark episode is, fittingly enough, directed by series star Mariska Hargitay, who’s played NYPD Detective Olivia Benson since “SVU” premiered in 1999. (Chris Meloni, who played Benson’s original partner, Detective Elliot Stabler, left the series in 2011.)

“Mariska is much more than a TV actress — she’s literally a female icon for American women from the ages of 14 to 104,” says Dick Wolf, who created the original “Law & Order” (456 episodes in 20 seasons) and its subsequent spinoffs. (“SVU” is the last of the “Law & Order” shows still in production; “Law & Order: True Crime” is on the horizon.)

“[Olivia] represents an ideal, in one sense, but a person who is relatable because of her flaws,” Wolf says. “It’s an amazing achievement that Mariska has been able to maintain this degree of focus for this long.

“Emotionally, she’s got the perfect pitch.”

Wolf, 70, spoke to The Post about “SVU,” about what’s made the series so durable and what the future holds for Detective Benson.

‘Mariska is much more than a TV actress — she’s literally a female icon for American women from the ages of 14 to 104.’ - Dick Wolf on 'SVU' star Mariska Hargitay

What’s the secret to the show’s longevity?

A very simple reason. It goes back to when it was initially called “Sex Crimes” and [then-NBC programming chief] Garth Ancier didn’t want “sex” in the title because of advertisers. I said, “You know what, Garth? It will test horribly, but who’s not going to watch?” Along with food, sex is the most basic element of human life. We can’t get here without sex. It’s endlessly fascinating. And Mariska [as Benson] is not only representative of what’s best and what we hope for people [working on sex crimes] who have to be empathetic, but she’s a hero to cops. There are not that many people on the planet who can appeal to 18- to 49-year-old women and 60-year-old cops.

What’s your most memorable “SVU” episode?

One of the ones that sticks out, even after 18 years, is the pilot [“Payback”], which asked so many provocative questions. When you start a series with somebody’s penis being sliced off, you’d better have a pretty good reason — that was during the Serbian and Bosnian ethnic cleansing — and we touched on a lot of subjects. Chris and Mariska truly hit the ground running in that episode. The [2003] episode on Tay-Sachs raised so many fundamental moral issues about life and death. Judd Hirsch was amazing. I tell writers that if you’re going to look at one episode after the pilot, it’s that one. A high-water mark. The best episodes are the ones that are morally dichotomous — you hear both sides of the argument and agree with both sides.

What are the chances for a 19th season?

I don’t want to tiptoe past the graveyard. I know nothing. But I think the show is doing extraordinarily well this season. I certainly don’t anticipate it being canceled; at this stage, I’m fully anticipating [NBC] is going to want another season — at least in my mind another three seasons.

They’re on the guest list

Over the course of its 18 seasons, “Law & Order: SVU” has amassed a stellar list of guest stars.

Here are some of the more memorable A-listers who signed up for an “SVU” episode:

Leslie Caron (Season 8)

Won an Emmy for her role as a woman who comes forward 40 years after her rape to help put away a serial rapist (guest star Charles Shaughnessy).

Robin Williams (Season 9)

Guest-starred in “SVU’s” 200th episode as Merritt Rook, a desperate man who seeks vigilante justice against the doctor who loses his pregnant wife (and their baby) on the operating table. He escapes from the police and dives into the East River. They assume, because he’s handcuffed, that he died.

Carol Burnett (Season 10)

Burnett snared an Emmy nomination for her role as Birdie Sulloway, a Norma Desmond-type aging dancer who glories in her past stardom. She and her nephew are suspected of killing her husband and three neighbors.

Julie Bowen and Luke Perry (Season 10)

The future “Modern Family” star (Bowen) and Perry (now starring on The CW’s “Riverdale”) guest-starred as a foster family who take in a troubled boy. When he tries to escape, the detectives learn that the husband is a rapist who married one of his victims.

Isabelle Huppert (Season 11)

Played Sophie Gerard, a desperate mother whose son is kidnapped, then dies in the car chase to rescue him. Distraught, she disarms an officer and takes everyone hostage. When she learns that her husband staged the kidnapping to keep the boy from her, she turns the gun on him, but ADA Jo Marlow (guest star Sharon Stone) talks her out of pulling the trigger. — Michael Starr