The upcoming fifth season of “Orphan Black” will be the show’s last. Speaking at a Comic-Con panel Friday, the show’s cast and producers discussed the decision to end the BBC America sci-fi drama.

“We sort of had five seasons in mind, and the thing that we just didn’t want to do is get kind of soft around the middle,” said executive producer and co-creator Graeme Manson. “We think that it’s better to cancel yourself than to get canceled, than to peter out.”

Manson and fellow co-creator and executive producer John Fawcett said there is a set ending that they and the writers are working toward.

“As much as planning the final season is bittersweet, the fun is knowing the ending, because we’ve known it for a really long time,” Fawcett said.

Series star Tatiana Maslany — who was nominated last week for an Emmy Award for best actress in a drama — said she doesn’t know what the ending will be.

“I sat in the writers room for a day early on in the season to hear a little bit about how it’s starting, but I have no idea” how it ends, she said.

Maslany also announced that the show will hold a contest in which the winner will be cast for a walk-on role in season five. Details of the competition will be announced.

BBC America announced in June that “Orphan Black” had been renewed for a fifth and final season of 10 episodes. The series is produced by Temple Street in association with BBC America and Space.