Robin Williams was in the running to play Professor Lupin in the “Harry Potter” films but lost out on a technicality.

Chris Columbus, who directed the first two “Harry Potter” films in the franchise, told Total Film about how Williams wanted to play Lupin.

RELATED: Actor Jamie Costa’s Uncanny Spot-On Impersonation Of Robin Williams Leaves Viewers Calling For A Biopic

“I had a conversation with Robin Williams, who wanted to play Lupin,” Columbus said, before revealing that they only would cast British actors.

Adding, “It was very difficult for me to say ‘It’s all British. There’s nothing I can do.’”

The part of Remus Lupin went to David Thewlis.

RELATED: Ethan Hawke Thought Robin Williams ‘Hated’ Him During Filming Of ‘Dead Poet’s Society’

During a 2001 interview, Williams told The New York Post about his wishes to have been cast in “Harry Potter”.

“There were a couple of parts I would have wanted to play, but there was a ban on [using] American actors,” he said. “Maybe one day. Say if [Harry] goes to Yale and becomes president.”

Columbus also dished on Alan Rickman playing Professor Snape and his doubt that he would take the role.

“I didn’t really think Alan would do it after playing such an iconic villain in ‘Die Hard’,” Columbus said. “I can’t imagine anyone else playing Snape. And Alan was just the utmost professional.