Ashildr, daughter of Einarr (Ian Conningham), is introduced in "The Girl Who Died" (2015), where she is portrayed as a Viking puppet maker and storyteller. When the militaristic alien race the Mire raid her village, Ashildr declares war between the village and ten of the Mire. As part of a battle plan devised by the alien time traveller the Twelfth Doctor (Peter Capaldi), Ashildr uses the technology inside one of the Mire's helmets to create an illusion to scare the Mire into a retreat. In doing so, she dies of heart failure, having been "used... up like a battery" by being connected to the Mire's machine. The Doctor's companion, Clara Oswald (Jenna Coleman), a time-travelling school teacher from 21st century England, persuades the Doctor to save her. He implants Ashildr with Mire medical technology, bringing her back to life and making her functionally immortal, but he worries that there will be consequences.
In the following episode "The Woman Who Lived", the Doctor catches up with Ashildr in 1651 England after 800 years have passed for her. She has become a highwayman, adopting the new name of "Me". Having lived through many wars and suffered many losses, she plans to travel the galaxy with an alien Leonian called Leandro (Ariyon Bakare) after the Doctor helps her retrieve an amulet called the Eyes of Hades, not knowing this will create a portal using the death of rival highwayman Sam Swift the Quick (Rufus Hound). However, Leandro betrays Ashildr and, instead, summons a fleet of ships to attack Earth. Ashildr uses her spare piece of Mire medical technology to restore Sam's life and close the portal to Leandro's world. She promises the Doctor that she will watch over his companions on Earth, keeping them safe after they stop traveling with him. Shortly afterwards, he spots her in the background of a photo on Clara's mobile phone taken in the 21st century.
When the Doctor next encounters Ashildr in "Face the Raven", she runs an alien refugee camp hidden in the heart of 21st century London, having lured the Doctor in using Rigsy (Joivan Wade), an old acquaintance of his, as bait. In a reckless attempt at subverting Ashildr's plan and saving their friend's life, Clara deliberately gives herself a death sentence to buy more time, without realising that Ashildr cannot remove it. A now-remorseful Ashildr takes the Doctor's key to his time machine, the TARDIS, and sends him to a trap on behalf of her collaborators, who are revealed in "Hell Bent" to be the Doctor's own race: the Time Lords.
In the ninth series finale "Hell Bent", the Doctor attempts to help Clara cheat death and runs away with her to the planet Gallifrey at the end of time itself, where Ashildr remains the last being in existence. She counsels the Doctor to stop his current course of action, for the sake of the universe, and so the Doctor and Clara submit themselves to have one of them wiped of their memories. The Doctor loses his memories of Clara, who returns him to Earth and reunites him with his TARDIS, but departs with Ashildr for adventures of their own in a newly acquired TARDIS of their own. Clara promises Ashildr she will return to Gallifrey to face her death as history records, but not before seeing the universe in more depth first.
Head writer and executive producer Steven Moffat said about having Williams on Doctor Who, "We're thrilled to have Maisie Williams joining us on Doctor Who. It's not possible to say too much about who or what she's playing, but she is going to challenge the Doctor in very unexpected ways. This time he might just be out of his depth, and we know Maisie is going to give him exactly the right sort of hell."
Maisie Williams said about her role in Doctor Who, "I'm so excited to be working on Doctor Who as it's such a big and important part of British Culture. I can't wait to meet the cast and crew and start filming, especially as we'll be shooting not too far from my home town."
When speaking about being in Doctor Who, Williams said, "People say 'don't meet your idols as they never turn out to be who you want them to be'. That was completely not the case with Peter and he's been wonderful and really helpful on set" about Peter Capaldi.
In 2016, Williams confirmed that she will not return to Doctor Who. However, the following year she said that there is no reason she couldn't come back in the future. She did state that she hasn't been asked to return either.
When talking about the episode "The Girl Who Died", Mike Reyes of Cinema Blend said about Ashildr that "Sure enough, Ashildr's death and rebirth after fighting the Mire went from a happy ending to an ending that gave me pause. The Doctor has now officially created a functional immortal out of a normal human, and given how he's held up with such a life span, it looks like things are about to get scary."
Sam Warner of Digital Spy reported that "Opinion was mostly positive, though Ashildr hasn't convinced everyone just yet" when talking about the character's debut appearance.
Williams described her role in Doctor Who as "every fan-boy's dream".
Liz Raftery of TV Guide described Williams' role as "highly anticipated" and Williams then went on to explain "When you cross over to a different geeky fandom world, everyone's like, 'This is insane!'"
In a review for the episode "The Girl Who Died", Williams' portrayal of Ashildr is described by Rob Smedley of the website CultBox as "envied natural talent that ... lifts Ashildr above being convenience or novelty".
Reviewing the episode "The Woman Who Lived", Smedley discussed Williams' portrayal of Ashildr as "a terrific job of making the character feel like she’s lived lifetimes since we last saw her. Several hundred years of loss in just one week. It’s an even better, and inevitably more mature, performance than last Saturday."