Sherlock is to return with a Christmas special next year in addition to a three-part series, the BBC confirmed.
Filming on the seasonal edition of the BBC One show - starring in-demand actors Benedict Cumberbatch as Holmes and Martin Freeman as John Watson - will begin early next year.
The third series bowed out earlier this year with Holmes appearing to shoot villain Charles Augustus Magnussen, and teased viewers that Moriarty may have cheated death.
A series of mysterious tweets leading up to the announcement had seemed to suggest Moriarty could be back again, with BBC One posting: "'Did you miss me?' #221back. #Sherlock" with a still of Moriarty announcing his last return to the show during an episode where his face and a message reading "Miss me?" popped up on TV screens.
Later, BBC One added: "It's all gone dark... Something's coming... Or someone. Details at 2.21pm tomorrow. #221back #Sherlock."
Show co-creator Mark Gatiss also tweeted: "It's all gone dark... Something's coming... Or someone..."
TV bosses had already said the show would return and Freeman said in an interview at the weekend that a Christmas edition was being planned.
The writer and co-creator of the series Steven Moffat said: "A special, plus a new series of three episodes - it's a record-breaking run.
"Of course, it's far too early to say what's coming, but we're reasonably confident that the very next thing to happen to Sherlock and John, is the very last thing you'd expect ."
Until now the programmes have been commissioned in runs of three shows.
Mark said the episodes "will take Sherlock and John Watson into deeper and darker water than ever before".
Sue Vertue, the executive producer for production company Hartswood Films, said: "It's taken a little while to get the dates sorted as none of the boys are exactly sitting back twiddling their thumbs but there was unanimous goodwill to make this work so we're thrilled that 221b is going to be inhabited again."
When the series came to its climactic conclusion earlier this year, it was made clear that the busy schedules of the on-screen talent and the creative team meant it could take some time before a further series was ready.
Steven also runs Doctor Who, while Benedict and Martin have screen and stage commitments.
BBC One controller Charlotte Moore said: "It's no mean feat pinning down some of this country's most brilliant and in demand actors and writers."