The Scottish actor, better known for playing foul-mouthed spin doctor Malcolm Tucker in The Thick Of It, has been cast as Balthazar - one of the three wise men - in Nativity.
The retelling of the Bible story will be broadcast on BBC One at Christmas.
He is joined by Cranford actor Andrew Buchan and former Holby City star Art Malik in the drama, which is a retelling of the Bible story by Life On Mars writer Tony Jordan.
According to the BBC, Nativity will focus on the love story between Mary (played by newcomer Tatiana Maslany) and Joseph (played by Buchan) and the "emotional turmoil" they go through when they learn that Mary is pregnant.
Ben Stephenson, controller of BBC Drama Commissioning, said: "We are proud to bring audiences this beautiful story retold for Christmas 2010 by a master storyteller.
"We hope our version of the Nativity will give audiences all the wonder, magic and inspiration of the original whilst also telling a less familiar tale, that of ordinary people going about their lives with no sense of the enormous importance their story would hold for centuries to come."
Jordan added: "The challenge for me was to retell a story that has been told countless times before, a story that everyone knows intimately, yet to do so in a way that will still surprise and move you, to see parts of the story you'd never seen before."
Nativity will be broadcast in four half hour episodes over four nights.