Jed Mercurio and the stars of Line Of Duty are to get matching tattoos after the controversial series finale earned more than 12 million viewers.

During Sunday night’s episode of the BBC One series, DSU Ian Buckells, played by Nigel Boyle, was unmasked as the mysterious H, the corrupt police officer at the top of a criminal conspiracy.

Martin Compston, who plays Steve Arnott, revealed that he, Adrian Dunbar (Ted Hastings), Vicky McClure (Kate Fleming) and series creator Mercurio had agreed to get “AC12million” tattoos if the show hit the milestone.

He joked that it was an “inconceivable and ridiculous scenario”.

The much-anticipated episode was watched by an average of 12.8 million people, with a 56.2% share in overnight viewing figures, making it the most watched episode of a drama in 20 years, the BBC said. The episode also had a peak viewing figure of 13.1 million.

In a message posted on Twitter, Compston thanked those who had reached out to him since the episode aired.

He wrote: “Hey folks now the madness is slightly dying down just want to thank everybody who reached out about last night and the series as a whole, we’ve truly been blown away by the reaction and love for the show we’re proud of it.

“Fully understand it wasn’t the ‘urgent exit’ type ending some anticipated but we appreciate you sticking with us.

“Felt many emotions from excitement and anxiety at the hype to relief that it’s over. Now I just feel immense pride our show that started on Wednesday’s on BBC2 has just smashed every overnight drama record since they began.

“Finally myself, Vicky, Adrian and Jed made an agreement in the inconceivable and ridiculous scenario we ever got twelve million viewers we would get ‘AC12million’ tattoos. We’ll see who’s good to their word……”

Fans of the series were divided over the finale reveal, with Irish author Marian Keyes tweeting: “Like, NO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I’ve NEVER felt so LET DOWN!!!!!! #LineOfDuty.”

Some critics were impressed, with The Times’ Ben Dowell giving it four stars out of five, writing: “Perhaps Mercurio has more surprises in store. It’s the sort of thing he does. Roll on series seven I say.”

Charlotte Moore, the BBC’s chief content officer, said: “Addictive event television, Line Of Duty has kept the nation guessing for the last seven weeks, so it’s no surprise that last night’s jaw-dropping finale set a ratings record.

Martin Compston as DS Steve Arnott
Martin Compston as DS Steve Arnott (World Productions/Steffan Hill)

“Jed Mercurio is a master of his craft, and I would like to congratulate him and the entire cast and crew for delivering such an incredible drama series. I’m looking forward to having a conversation with the team about where we go next and what the future of the series might be.”

Line Of Duty has pulled in millions of viewers as people speculated on the identity of the mystery character.

The penultimate episode earned an average of 11 million viewers and 51.7% of the audience share, according to the BBC.