Costume crime drama Ripper Street has been resurrected and is heading back to the BBC as part of a deal with internet giant Amazon that will see it premiere online before being shown on TV.

The new series of the show, axed last year after the BBC said it "didn't bring the audience we hoped", will be shown first on Amazon's on-demand Prime Instant service which will also re-run the first two series.

Cast members including Matthew Macfadyen and Jerome Flynn, who both play detectives working in 19th century Whitechapel in east London, start filming in May.

Jason Ropell, head of Amazon instant video international content acquisition, said: "We're delighted to have secured not only the highly popular first two seasons of Ripper Street for our Prime Instant Video customers, but we can also confirm today that we will making season three, news that we know will delight the millions of fans of this brilliant British drama."

BBC drama boss Ben Stephenson said this was "an exceptional opportunity" to bring the show back.

He said: "This deal gives fans another series of the show they love at excellent value to the licence fee-payer, ensuring that the BBC can also commission an entirely new, yet-to-be-announced drama series."