The long tradition of Second City actors entertaining passengers on Norwegian Cruise Line boats is coming to an end.

The Chicago-based comedy company’s contract with the cruise ship line will conclude in early 2018,  Second City confirmed on Thursday.

Second City troupes have been a fixture of the entertainment for NCL ships since 2005, with trained comic actors performing sketches and improv at onboard comedy clubs. Three of the line’s boats — Breakaway, Dawn and Gem — now feature Second City ensembles.

Along with roaming from town to town in a touring company, performing on a ship is a rite of passage for up-and-coming Second City actors, who also give improv lessons to passengers. So established is the tradition that when Liz Lemon, the comedy writer played by Second City alum Tina Fey on “30 Rock,” was asked where she’d be in five years, her reply was, “Realistically? Teaching improv on cruise ships.”

Traditionally a troupe consists of five or six actors and a musical director, with a director staying briefly on board to set up the show. According to Beth Kligerman, a producer who oversees casting for the cruise line shows, the material performed on shipboard is “mostly on classic Second City themes, like relationships. We don’t hit those audiences hard” with edgy political material.

Three more cast changeovers on cruises will take place between now and Jan. 3.

“Not long ago NCL built its own facility in Tampa, Florida, and they have been producing in-house creations, including productions of such musicals as ‘Priscilla, Queen of the Desert’ and ‘Rock of Ages,’ ” said Kligerman. “As for finding alternatives for the Second City, we are just beginning to work on that. But we are very proud of the fact that we have had a successful run with NCL for 13 years.”

Kligerman said she was unable to speak about what the potential loss of revenue would be with the cessation of Second City’s contract with NCL.

Contributing: Hedy Weiss