Three-part BBC thriller The Replacement finished on a high as it scored its biggest audience of the series, despite dividing viewers over the ending.

The programme followed the tale of architect Ellen (Morven Christie), who fears her maternity cover Paula (Vicky McClure) is sabotaging her, prompting her to uncover a twisted web of secrets that Ellen suspects was the cause of the gruesome death of her boss.

While Tuesday night’s episode left many fans in the dark due to its sudden resolution, it was a ratings success.

The ReplacementThe Replacement (Mark Mainz/BBC/Left Bank)

The hour-long episode was watched by 5.8 million people and had a 27.7% audience share in the 9pm timeslot, according to overnight figures.

The first two episodes had scored five million viewers apiece in the overnights.

These figures do not account for those watching on catch-up service iPlayer.

Tensions reached boiling point in the fast-paced finale of the programme, with some viewers unclear whether Ellen was being paranoid about Paula’s actions after the two underwent a cat and mouse-style scenario.

The ReplacementThe Replacement (Mark Mainz/BBC/Left Bank)

The ending saw Paula take Ellen’s newborn baby hostage in an attempt to teach her a lesson about being a good mother, after revealing that her own daughter had died two years before.

But the abrupt conclusion – which included Ellen skilfully hotwiring a car to smash her way out after being locked in by Paula, and Paula owning up to the crime of killing their boss Kay (Neve McIntosh) – saw viewers take to social media to complain about the storyline.

One person commented on Twitter: “The end of The Replacement was soooo disappointing. I’m not happy.”

Another said: “The replacement was so so so so good until that ending.”

A third viewer agreed: “Disappointing ending to The Replacement, after all that build up it was such an anti climax.”

Pointing out the issues that still seemed unresolved, one person complained: “I don’t get the ending? Did she admit to it all? How did she get found out? #TheReplacement.”

There were positive reviews for the programme, too, as one person enthused: “THE REPLACEMENT, round of applause for BBC, what an INTENSE series that was, my blood pressure is highhhhhh.”

Another added: “#TheReplacement was nonsensical from start to finish but I liked it!”

Some fans have asked for a second series, but the show’s writer Joe Ahearne has said it was intended as a standalone drama.

According to the Radio Times, Ahearne said The Replacement is “very much a self-contained drama”.

He said: “I think it’s quite good to leave people wanting more. And also, I think it would be quite difficult to get those two characters together without either amnesia or plastic surgery.”