Robin Williams was one of the most beloved actors of his time, but even that wasn't enough to get him a role in Harry Potter.

The 'only British' rule was so important for the film franchise that Williams was told he couldn't be cast as Hagrid, casting director Janet Hirshenson told the Huffington Post.

"Robin [Williams] had called because he really wanted to be in the movie, but it was a British-only edict, and once he said 'no' to Robin, he wasn't going to say 'yes' to anybody else, that's for sure," she said. "It couldn't be."

Hirchenson also revealed that Robbie Coltrane was JK Rowling's first choice to play the role of Hagrid.

Williams himself said hat he lobbied for a part in the movie in a 2001 interview.

"There were a couple of parts I would have wanted to play, but there was a ban on American actors," he told the New York Post.

He didn't rule out a role in one of the sequels, though: "Maybe one day. Say if [Harry] goes to Yale and becomes president."

Williams attended the premiere of Harry Potter and the Philosopher's Stone when it debuted in New York.