A 41-year-old American woman has been arrested in Spain after physicist Professor Stephen Hawking allegedly received death threats.

Professor Hawking gave a talk at the Starmus Festival on the island of Tenerife flanked by armed police guards, according to The Local, and English-language news website, which cited La Opinión de Tenerife newspaper.

It said that the world-renowned scientist had received hundreds of unpleasant messages on Twitter and by email for several years.

However, after he arrived on Tenerife, he received dozens of messages in a few hours, reportedly including one that said “I’m next to you and can kill you”.

One of Professor Hawking’s children raised the alarm after seeing the messages on his social media accounts.

Spanish News Today reported the woman who was arrested was an American who normally lives in Norway.

She was detained in a four-star hotel near the Playa de Las Americas on the island.

In his address at the festival, Professor Hawking warned that increasingly intelligent robots might one day pose a threat to humanity.

“I don’t think that advances in artificial intelligence will necessarily be benign,” he said.