After 10 years and 240 episodes, “Hawaii Five-O” washes ashore for the last time on April 3, at a moment when escaping into the series — whose predecessor embodied what came to be known as “blue sky” shows — has perhaps never felt quite so welcome.

Producers of the CBS drama weren’t certain that this would be the end until shortly before filming had begun, but executive producer Peter M. Lenkov said they had been approaching every season as if it might be their last for the last few years.

hawaii-five-o-after-10-seasons-with-its-series-finale-1

According to Lenkov, the writing team wouldn’t have done much differently if they had known farther in advance that the show would be officially concluding. The long-running program had become expensive to produce, and star Alex O’Loughlin, who plays Five-O leader Steve McGarrett, had been discussing departing for some time.

hawaii-five-o-after-10-seasons-with-its-series-finale-2

While there was the possibility that the series could have continued without him, the finale — subtitled “Aloha” — will bring an element of closure to McGarrett’s story, while incorporating some familiar faces to pick up old threads. “I was pretty sure that this would be his last year,” Lenkov told CNN, noting that there were many factors that went into deciding to finish the series. “It just felt like the right time,” he said.

hawaii-five-o-after-10-seasons-with-its-series-finale-3

Ratings for “Hawaii Five-O” have spiked upward the last few weeks, not only building toward the finale but reflecting an appetite for “comfort food” on the part of viewers facing shelter-at-home orders. Although the series is ending, this might not be the last we see of some characters. Lenkov also oversees CBS’ reboot of “Magnum P.I.,” and the two shows produced a crossover event in January.