LONDON — The BBC has cancelled period crime series “Ripper Street,” which stars Matthew Macfadyen, due to poor ratings.

The gritty detective drama, which airs Stateside on BBC America, has run for two seasons, but there will be no third season.

The first season attracted an average audience of 7.1 million on a Sunday night, but the audience for the second season drew around 4 million on a Monday evening. When the latest season of jungle challenge show “I’m a Celebrity… Get Me Out of Here!” launched on rival ITV in the same timeslot, “Ripper Street” lost 670,000 viewers. Last Monday’s episode of “Ripper Street” took 3.26 million compared with 8.8 million for “I’m a Celebrity.”

A BBC spokeswoman said: “We are very proud of ‘Ripper Street,’ which has enjoyed two highly ambitious series on BBC One. However, the second series didn’t bring the audience we hoped, and in order to make room for creative renewal and new ideas it won’t be returning.”

One of the show’s actors, Jerome Flynn, revealed the show was being axed during an interview on the radio station BBC London on Tuesday.

Flynn said: “We found out this week that the third series of ‘Ripper Street’ isn’t going. We’re all in shock.

“It was up against ‘I’m a Celebrity … Get Me Out of Here!,’ and that’s been cited as one of the reasons in terms of viewing figures.

“We’re all in absolute shock because it’s a wonderful job and we feel like it’s kind of this unfinished work. So we’re hoping it will turn around if anyone from the BBC is listening.

“There’s these wonderful storylines which Richard (Warlow) and Toby (Finlay), the writers, have marked out and it’s one of the most captivating characters I’ve played, and also been part of in terms of the story, so it is suddenly like a marriage being broken.”