When Michael Emerson signed on to star in CBS’ “Person of Interest” in 2011, he had no idea — or, truthfully, any hope — that the series would make it 100 episodes. The show’s pilot was the first he’d ever made. In fact, before he got the role of Benjamin Linus in “Lost,” he says, he could never get hired to be part of a show’s original cast.

“When you start out with a show, you think of it as, ‘OK, this is a pilot. It’s a job. I don’t think you really have an expectation of it going,’” Emerson says. “Actors, we just train ourselves over the years not to hope too much. So when it does actually go, you think, ‘Oh my God. I’m going to have to really do this. I’m going to have to do it a lot. One hundred episodes, possibly. Hahahaha!’ It doesn’t seem real.”

Half a decade later, the “Person of Interest” star is at the center of the show’s 100th episode, titled “The Day the World Went Away,” which airs May 31. In a show in which an artificial intelligence sends a team of skilled operators to save potential crime victims who are only identified by their Social Security numbers, it’s a very bad thing if your number comes up. Unfortunately for tech genius Harold Finch (Emerson) that’s precisely what happens.

“It’s a big corner we turn. There are casualties and huge decisions to be made about Mr. Finch’s ethical relationship to the Machine that he’s made,” Emerson teases. “Everything gets a little blurrier and a little more terrifying.”

“Person of Interest” premiered on Sept. 22, 2011, a decade after the terrorist attacks on Sept. 11, 2001, which changed the world’s relationship with security, surveillance and privacy issues forever. Created by Jonathan “Jonah” Nolan, who co-wrote the scripts for “The Dark Knight” films, the crime thriller began as a fictionalized study of the “what-ifs” posed by our embrace of the surveillance state. It has since transformed into an exploration of artificial intelligence’s potential dark side.

“I think what’s appealing about the show is that it’s not a superhero show where Superman flies,” says Emerson’s co-star, Jim Caviezel. “It’s a show that has real possibility and real technology that is happening right before us.”

At the center of the story, Finch and his partner John Reese (Caviezel), an ex-CIA operative, take on a world of crime. Finch is the billionaire inventor of the Machine, a powerful computer system imbued with elements of artificial intelligence. Government agencies use the Machine’s findings, culled from scanning closed-circuit camera footage, mobile phones and Internet activity, to find terrorists before they can strike.

But Finch’s creation also finds perpetrators or targets of potential crimes involving ordinary citizens. The government ignores these numeric predictions, deeming them “irrelevant.” That’s where Finch and Reese come in, assisted by various partners known to the show’s fans as Team Machine.

Team Machine initially consisted of the duo and two New York police detectives, Joss Carter (Taraji P. Henson) and Lionel Fusco (Kevin Chapman), plus a charismatic dog named Bear. A reformed hacker assassin, Samantha Groves, aka Root (Amy Acker), soon came aboard, eventually serving as the Machine’s “analog interface,” allowing it to communicate with the group.

Another former special forces operator, the emotionally distant Sameen Shaw (Sarah Shahi), later joined up and became the object of Root’s affections. Their relationship inspires a great deal of passion among the show’s most devoted viewers who, aptly enough, refer to themselves as Irrelevants.

Carter, meanwhile, died in a pivotal third season arc that marked one of the series’ creative high points and shocked the series’ fans.

“Person of Interest” averaged 14 million viewers during its first season, growing its viewership to more than 16 million in Season 2, when it was the fifth most-popular series on television, according to Nielsen ratings. But it finished Season 4 with a season average viewership of 12 million and ranked 54th in the 18-49 demographic. Season 5, announced to be the show’s last, premiered on May 3 to an audience of 7.35 million, according to live-plus-same day numbers.

The series finale is scheduled to air June 21. “It’s especially bittersweet and difficult to lose a show that I still believe had many years left in it,” says Peter Roth, president and chief content officer, Warner Bros. TV. “I think the show was beautifully evolved. I loved the way Jonah never stayed with the tried-and-true. He constantly evolved with the conceit of the show. I really applaud his ingenuity and his daring.”

Addressing how he hopes fans will receive the series ender, Nolan says the producers “feel that we’ve settled our debts honorably.”

Since Season 1, “Person of Interest” has consistently embraced cinematic action and the unease of technology’s creeping intrusion into our private lives in equal measure. It employs a unique style as well, sharing the storytelling perspective of both the human characters and Finch’s all-seeing Machine.

Nolan and fellow executive producer and showrunner Greg Plageman executed each installment as if it were a 44-minute thriller. “It’s been a fascinating moment of trying to write a TV show with all of this stuff changing faster than even we can chart it,” Nolan says.

In New York City, where production took place, Plageman says they came to be known as “that show” to local production crews and the NYPD — the show where firefights break out in Midtown office buildings and anything that can go up in a ball of flame eventually does.

“There are so many things I was used to doing in television,” says Plageman, whose previous producer credits include “NYPD Blue” and “Law & Order.” “I self-censored and said, ‘Well, we can’t blow that up, or flip a car, set it on fire in the middle of Manhattan.’ And then Jonah said, ‘Why not?’ And we were doing it.”

“Nobody ever told us how a TV show is supposed to work,” Nolan jokes, “so we just kind of went hell bent for leather with this thing, and made a mess, and continue to do so.”

This is also true of the landmark 100th, which Nolan calls “a celebration of all of the things the show has done over the years. Which is to say, we present some provocative ideas, blow up a lot of s–t, and really piss off a lot of fans by killing off a couple of major characters.”

In these final episodes, Samaritan, a sinister program with no regard for personal privacy or respect for due process, is using its army of human agents to hunt the Team. While the Machine has been reduced to a bootstrapped network running out of an abandoned subway car, Samaritan has insinuated itself into the highest levels of government and is moving to consolidate its power.

All of this may seem far-fetched to the average viewer who watches “Person of Interest” for its escapist action adventure plot. But over the course of the drama’s five-year run, some of its fictional scenarios flirted more closely with fact than the show’s producers or cast could have imagined.

The most significant example of this is the first-season episode “No Good Deed,” which premiered in May 2012 and featured the story of a young National Security Agency whistleblower who attempts to tip the press about the government engaging in illegal mass surveillance.

Unlike another network’s long-running crime procedural, “Law & Order,” this story wasn’t ripped from the headlines — it pre-dated coverage of Edward Snowden’s explosive document leaks by more than a year.

Snowden’s revelations moved the cast to reconsider relationships with expectations of informational privacy — as well as the average tech consumer.

“I don’t use the Internet anymore,” Caviezel says. “How about that?” He admits he’s not completely off the grid; he uses text messaging, a mobile phone and his family surfs the Web. But you won’t find him on social media. And if he wants to organize his thoughts or needs a reminder about a task, “I just write it down.”

Emerson has curbed the use of his mobile phone, he says, “because I see the erosion of our social behaviors.”

Chapman has a different take to share. A few years ago, when he discovered his parked car had been hit while he was attending a sporting event with his daughter, he used what the show taught him about the near-omnipresence of closed-circuit cameras to track down the culprit.

“I told the security guy who I was and what had happened,” he says. “He rolled back the footage from outside the building, and they were able to get the license plate number, and a picture of the guy hitting my vehicle. I would have never thought to do that if I hadn’t worked on ‘Person of Interest.’”