Mary Ellen Matthews/NBC

In one of his last appearances on the season finale of “Saturday Night Live,” a rapping Andy Samberg traded a rhyme with Chris Parnell that seemed loaded with underlying meaning: “On these New York streets I hone my fake rap penmanship / That’s how it began, and that’s how I’m-a finish it.”

This lyric from “Lazy Sunday 2″ was not only a bookend to the hit series of digital shorts that Mr. Samberg helped pioneer during his seven-season career on “S.N.L.”; it was also, as many had suspected, his farewell to that NBC late-night sketch series.

On Friday, Mr. Samberg confirmed that he will not be returning as a cast member on the next season of “Saturday Night Live.”

“It’s an incredibly emotional and strange moment in my life,” Mr. Samberg said Friday in a telephone interview. “Obviously it’s not a huge shock, but I did officially decide not to come back.”

Not long after joining “S.N.L.” in the fall of 2005, Mr. Samberg and his frequent collaborators Jorma Taccone and Akiva Schaffer (who as a trio comprise the comedic hip-hop group the Lonely Island) delivered their first hit viral video for the show: “Lazy Sunday,” a rap video in which Mr. Samberg and Mr. Parnell rhyme about their enthusiasm for unthreatening cultural offerings like Red Vines licorice and the children’s adventure movie “The Chronicles of Narnia: The Lion, the Witch and the Wardrobe.”

Other successes followed, including “I’m on a Boat,” “I Just Had Sex” and a collaboration with Justin Timberlake about the surprising gifts they put in boxes and offer to their paramours.

Leaving the show was “one of the hardest decisions I’ve ever made,” said Mr. Samberg, who added that he had come to this conclusion with some counsel from Kristen Wiig, an “S.N.L.” veteran who exited the show with a bittersweet Rolling Stones sing-along at the end of the season.

“She kept saying it just feels like it’s her time,” Mr. Samberg said. “I connect with that. Something about it just feels like it’s the moment. My contract’s up and I did so much more than I ever thought I would ever even do.”

Mr. Samberg left open the possibility that he and his Lonely Island partners might still contribute occasional shorts or other works to future “S.N.L.” episodes. “That’s the kind of thing that I really do hope happens,” he said.

With a coming schedule of roles in summer movies like “That’s My Boy” and “Celeste and Jesse Forever,” Mr. Samberg said he looked forward to dodging the now-inevitable questions about when he might return to “Saturday Night Live” as a host.

“Well, hopefully things will work out well enough that they’ll want me,” he said.