Sherlock writer Steven Moffat has admitted he had no idea the series would become a "phenomenon" and had initially viewed it as a vanity project with little more than cult appeal.

The executive producer of the BBC1 show admitted he was still at a loss to explain its success as the show's third series bowed out with an average audience of 8.8 million watching the season's climax.

Viewers saw the programme finish with the prospect that Moriarty may be still alive, after he had been thought to have killed himself at the conclusion of the second series.

Reacting to the finale's audience Moffat, the executive producer and co-creator of Sherlock, said: "It isn't supposed to be like this. Sherlock began life as a surprise hit, and now in its third series, it's rating higher than ever.

"This show, which we all thought would be our vanity project destined for 3 million in the ratings and possibly an award from an obscure European festival, has become a barnstorming international phenomenon."

Moffat, who wrote the series with Mark Gatiss, went on: "If I live to be a very old man, I might be able to explain how any of that happened - drop me a line in about forty years, I'll do my best."

Previous episodes of this series have shown that they have been hugely successful on catch-up services.

The first programme screened on New Year's Day is said to be the most popular programme screened on catch-up services with a further 3.5 million watching the drama within seven days of it first airing, in addition to the 9.2 million who watched it live.

The final episode is expected to have a similar level of success with time-shift viewing.

Programme-makers have talked of further programmes but they need to be able to coordinate the diaries of in-demand stars Benedict Cumberbatch (Sherlock Holmes) and Martin Freeman (John Watson).

Sunday's edition of the show proved to be even more of a family affair than usual after show supremo Moffat's son played the great detective as a schoolboy.

Louis Moffat played the young Sherlock in a few scenes filmed as flashbacks during His Last Vow, which saw Holmes and Watson take on media magnate Lars Mikkelsen's blackmailer Charles Augustus Magnussen.

The show, which also stars Freeman's real-life partner Amanda Abbington as his on-screen wife, also featured another appearance by Cumberbatch's real parents as Holmes' mother and father.

Moffat's wife Sue Vertue - Louis' mother - is the show's producer and his mother-in-law, Beryl Vertue, is among the executive producers.

The youngster had appeared in an earlier episode as another character.