JK Rowling has revealed the inspiration behind the symbol for the Deathly Hallows.

Speaking in a new BBC documentary, the author says it's connected to a film that came out more than 40 years ago.

The film features a Masonic symbol - and is similar to the one that appears in Harry Potter.

She says she was watching the film when she found out her mother had died - and that something must have sunk in on a "subconscious level".

The documentary called Harry Potter and the History of Magic - which you can watch on the iPlayer - was made to celebrate the 20th anniversary of The Philosopher's Stone.

In it, JK Rowling discusses the inspiration behind the series and characters.

At one point, she talks about drawing the first sketches for Professor Sprout, the herbologist.

It was late at night and she was watching the 1975 film The Man Who Would be King, starring Sean Connery and Michael Caine.

Warning: Third party content, may contain ads.

"The Masonic symbol is very important in that movie," said JK Rowling.

But how can she be so sure the two are connected?

"The reason I can be incredibly precise about when I drew this [the picture of Sprout], is that at some point when I was drawing the picture and watching the movie, my mother died."

Then, many years later she saw the film again and "went cold all over".

"I looked at the sign of the Deathly Hallows and realised how similar they are," she said.

"I've got a feeling that on some deep subconscious level, they are connected."

The Deathly Hallows is comprised of the Elder Wand, the Resurrection Stone and the Cloak of Invisibility. Whoever possesses all three is said to be Master of Death.

"The Potter series is hugely about loss," said the author.

"If my mother hadn't died, I think the stories would be utterly different and not what they are."

Harry Potter and the History of Magic coincides with a brand new exhibition at the British Library under the same name.

It features many of JK Rowling's original drawings and drafts plus "rare books, manuscripts and magical objects" from the Library's collection that "capture the traditions of folklore and magic which are at the heart of the Harry Potter stories".

Find us on Instagram at BBCNewsbeat and follow us on Snapchat, search for bbc_newsbeat