Andrew Scott as Ian Charleson in Elsinore —Courtesy of Focus Features

On the evening of Nov. 13, 1989, Ian Charleson walked onto the Olivier stage at London’s National Theatre to play Hamlet for the last time. He was 40 years old and dying of AIDS, though few of the 1,150 or so people watching from the dark knew it. The illness had puffed the skin around his eyes and affected his throat and chest, but the change in his face had been explained away as sinus surgery. The Olivier is the largest of the National's three auditoriums, its seats curving in a wide arc around the stage. It is a notoriously hard room to play to, one that tempts actors to force their voices. Charleson did not. Ian McKellen, who was there that night, later wrote of the younger actor delivering Hamlet's great speeches as one person talks to another, in a voice that stayed firm, making the huge auditorium feel uncharacteristically intimate. When Hamlet wished that his own flesh would melt away, Charleson's hands came up to shield his face, and they were thin and drained of color. At the end of nearly four hours, the audience rose to him. He never appeared onstage again.

Elsinore, in theaters beginning on Nov. 20, builds up to that climactic night. Stephen Beresford, the screenwriter of Pride, wrote the film, which follows Charleson through his last months. During that time, the actor best known for playing the Scottish sprinter Eric Liddell in the 1981 Olympic drama Chariots of Fire took on Hamlet, the grieving Danish prince and the longest role Shakespeare wrote, just as his body was beginning to fail him. Andrew Scott, who plays Charleson with wit and coiled ferocity, leads a cast that includes Olivia Colman as Margaret Johnson, the physician who treated him; Billie Piper as Patsy Pollock, the casting director and friend who cared for him; and Johnny Flynn as Richard Eyre, the director who gave him the part.

The film moves between the ward at the Royal Free Hospital in north London, where Charleson was a patient, and the rehearsal rooms of the National, where he was a prince, and carries him from the offer of the part, through the arguments over whether he should take it, to the ovation on his last night. Beneath the backstage detail and the Shakespeare, Elsinore hinges on the moment when a man who has been told how he will die decides how he will live until then, and on what that decision asked of those who loved him.

Director Simon Stone, whose stage work includes a production of Hamlet, says the people who loved Charleson were caught between protecting him and letting him choose.. "There's this terrible tension between wanting to preserve someone's life and also letting them determine the way that their own life is going to be lived," he tells TIME. "At the end of the day it was Ian's choice, and Ian's choice was an extraordinary gift, ultimately, for so many audience members that got to see him play that part."

The actor his friends remember

Andrew Scott and Joe Locke in Elsinore —Courtesy of Focus Features

Charleson was born in Edinburgh in 1949. His father was a printer. Local theater had the boy on stage by the time he was 8, and both his church and his school choir counted him among their sopranos. He reached the Royal High School and the University of Edinburgh on scholarships, enrolled to study architecture, and left as an actor. He trained at the London Academy of Music and Dramatic Art and, by the end of the 1970s, had worked his way to the National and the Royal Shakespeare Company.

Then came Chariots of Fire and Liddell. A devout Christian, the real-life athlete would not race on a Sunday, so at the 1924 Olympics he gave up his best event, the 100 meters, and won gold in the 400 instead. The film, known for its slow-motion sprint along a beach and its iconic synthesizer theme, was named Best Picture at the 1982 Academy Awards, and so, a year later, was Gandhi, with Charleson as the clergyman Charlie Andrews. His best work, though, was in the theater, much of it at the National, where Eyre directed him as Sky Masterson in a celebrated Guys and Dolls in 1982, and where, in 1988, he played Brick in Tennessee Williams' Cat on a Hot Tin Roof.

Beresford interviewed Charleson's friends and colleagues and found that grief had not made them solemn. "Because he was an actor, his friends are actors, and actors have a strong sense of humor," he says. "So I got a lot of stories from them that were very funny, and that really helped me to find his voice." Charleson, he adds, "really always saw the joke, both in life and in a play."

Scott heard the same from everyone he asked. "He was really deeply loved, Ian, by anyone who encountered him, and he was enormously fun," he says. "That, to me, was the key to him, that he was somebody who was very light in spirit. I think he was troubled, of course, as you would be by what he was going through, but I think he was enormously courageous, and he was very witty and funny, and he knew how to have fun. As an attribute in a human being, to be fun-loving is sort of underestimated sometimes."

But even after his success on screen and stage, one role still felt unfinished: Hamlet. Charleson was 25 when the Cambridge Theatre Company took him on tour in the part, and he came home unhappy with what he had done. In 1988, during the run of Cat on a Hot Tin Roof, he told Eyre across a canteen table at the National that he wanted a run at Shakespeare's great parts.

Hamlet is the meatiest of them all. Shakespeare set the play in the Danish castle of Elsinore, where a prince learns from his father's ghost that his uncle, now king and married to his mother, is the murderer. Told to take revenge, Hamlet spends most of the play failing to, feigning madness and asking, in the soliloquy that begins "To be, or not to be," whether life is worth going on with. By the end, nearly everyone at Elsinore is dead, Hamlet among them. "It is the actor's Everest," Beresford says of the role. And it is, he adds, the "ultimate play about life and death, and I think, faced with his own mortality, he saw an opportunity to express some of that, maybe."

Charleson's Hamlet has long been remembered as the performance of a dying man. His friends, and the film that follows them, remember a quick, funny, unsatisfied actor who was offered the part he most wanted at the worst possible moment, and took it.

An offer made out of friendship

Johnny Flynn as Richard Eyre with Andrew Scott as Ian Charleson —Courtesy of Focus Features

Eyre's Hamlet opened at the Olivier in March 1989 with Daniel Day-Lewis as the prince and Judi Dench as his mother. Several months into the play’s run, on the night of Sept. 5, during the scene in which Hamlet meets his father's ghost, Day-Lewis walked off in distress and did not come back. Day-Lewis was 15 when he lost his father, Cecil Day-Lewis, a poet, and he has said the scene confronted him with that memory. He has not acted on stage since. His understudy, Jeremy Northam, finished the performance that evening. The role that had brought one actor too close to a death would pass to another facing his own.

The walkout was sudden, but Day-Lewis had already been due to leave the production. Three months earlier, Eyre’s diaries record, the actor had said he would leave before the run ended. Eyre, who had become the National’s director the year before, offered the part to Charleson in August, while Day-Lewis was still playing it, and his diary says he did so on feeling more than pragmatism and judgment. Charleson was set to take over the role on Oct. 9.

Charleson had tested positive for HIV in 1986, and by 1989 his health was failing. The gravity of his illness was clear to Eyre, though the nearness of the end was not. Charleson wondered aloud to Eyre whether an actor who looked as he did could really play Hamlet. He would recover, Eyre told him, and Charleson answered that they had to stay hopeful. To Hilton McRae, an actor and a friend since their student days in Edinburgh, he put it as a joke: the audience would greet his first entrance by leafing through their programs simply to find out who he was.

Eyre made the casting decision out of friendship, and he has stood by it. He had a healthy, capable actor already playing the part, and most people around him thought the choice reckless. By the middle of September, Eyre's diary records, word had reached him that the Sunday Mirror was asking whether Charleson had AIDS and would be well enough to open the following month. Reporters came to Charleson's door in west London, and at the National, a vandal defaced his photograph with a cross.

The film compresses these events: on screen, the offer comes only after Day-Lewis has gone. Flynn plays Eyre as steady and generous; the real Eyre was less composed at the time. Stone never met Charleson, but he heard enough stories about him to guess how the argument was won. "He was an incredibly charming, gregarious, and very convincing person, and I imagine that when he wanted something, he was going to get it," Stone says. Letting an actor that weak play Hamlet was, he adds, a "terrifying thing," though Stone is thankful it happened all the same: by every account, the people in the room watched one of the great performances of their lives.

The people who held him up

Billie Piper as Patsy Pollock with Andrew Scott —Courtesy of Focus Features

In 1989, the combination drug therapies that would make HIV treatable were still years away. The one licensed drug, AZT, bought little time, and the stigma around the disease reached all the way into law: Section 28, passed by Margaret Thatcher's government in 1988, barred local authorities from what it termed promoting homosexuality. Charleson was open with his friends about being gay but had never come out publicly, and he kept his illness private as well.

Derek Jarman chose otherwise. The filmmaker who gave Charleson one of his first screen roles, in the 1978 punk film Jubilee, went public about his own HIV diagnosis within weeks of receiving it in December 1986, and his activism and visibility became central to his work. Charleson's work, for as long as he could still do it, required him to seem well. Elsinore pits the two against each other: David Dawson plays Jarman, and the two men argue on screen over what a gay artist owes the public during an epidemic. 

Charleson's doctor, Johnson, was a lung specialist early in her career, and the HIV service at the Royal Free was hers to build. His name meant nothing to her when he became her patient. She ended up dealing with the National as well: more than once, when Charleson felt too ill to telephone Eyre himself, she made the call for him.

Beresford sought out the real Johnson and asked about Hamlet. "I said to her, 'I understand you had reservations about Ian playing Hamlet,' and she said, 'Yes, well, I was right,'" he says. "And I said, 'What makes you say that?' And she says, 'Well, he's dead.'"

In that answer, Beresford heard a deadpan humor and a pragmatism, an "absolute truth-teller element," and the doctor and her patient became one of the film's central relationships. On screen, Colman's Johnson at first does not want him playing Hamlet. Charleson's reason for pressing on, as Stone quotes it: "I'd rather die of Hamlet than AIDS." Beresford built their scenes on two people who look like opposites, the scientist and the artist, and turn out to share more than either expects. "When they start to see that in each other, I think that's what changes her mind," he says. "I suppose in a way it's Shakespeare that changes her mind, because that's what he uses to get to her finally."