“Black Sails” is headed on its final treasure hunt. Starz announced that Season 4 will be the last for the pirate drama. It sounds like the showrunners were the ones who made the call to end the story in 2017.

“It’s a rare privilege in television to be given the kind of creative freedom we’ve enjoyed on this show over the last four years,” co-creator Jonathan E. Steinberg said in a press release. “While it was a difficult decision for us to make this season our last, we simply couldn’t imagine anything beyond it that would make for a better ending to the story nor a more natural handoff to ‘Treasure Island.’”

The drama, which started in 2014, is a prequel to Robert Louis Stevenson’s “Treasure Island.” It started 20 years before the story and fictionalized the lives of many real-life pirates.

The show did well both critically and in the ratings. Starz says that the show averaged 3.6 million viewers per episode. However, it did not receive much love from awards shows.The cancellation decision comes less than a week after a disappointing lack of Emmy nominations in major categories. The acclaimed series only received nods for sound editing and special visual effects.

However, the cast took that in stride. After the Emmy announcements, star Toby Stephens, who plays Captain Flint, thanked fans for support. “Thanks for all the kind words,” he wrote on Twitter. “Better than any nomination. Glad/proud the show got recognised though.”

If “Black Sails” viewers were upset when the Emmys failed to acknowledge the drama, it’s safe to say they aren’t happy about the cancellation. They went on Twitter to express their heartbreak:

“Black Sails” fans should remember that the show isn’t over yet. Season 4, which will have 10 episodes, won’t air until 2017 on Starz.

Black Sails canceled “Black Sails,” starring Toby Stephens (center), will end after Season 4. Photo: Starz