The coffin of Britain s Queen Elizabeth II is carried into St Giles Cathedral, Edinburgh, Scotland, Monday Sept. 12, 2022. AP
The man, a Yemeni national, on Monday published a video clip of himself on social media at the Grand Mosque in Mecca, Islam's holiest site, where non-Muslims are forbidden.
In the clip, he held up a banner saying: "Umrah for the soul of Queen Elizabeth II, we ask God to accept her in heaven and among the righteous."
The footage was widely circulated on Saudi social media, with Twitter users calling for the man's arrest.
Saudi Arabia forbids pilgrims to Mecca from carrying banners or chanting slogans.
And while it is acceptable to perform umrah on behalf on deceased Muslims, this does not apply to non-Muslims like the queen, who was supreme governor of the Church of England, the mother church of the worldwide Anglican communion.
Security forces at the Grand Mosque "arrested a resident of Yemeni nationality who appeared in a video clip carrying a banner inside the Grand Mosque, violating the regulations and instructions for umrah," said a statement carried by state media late Monday.
"He was arrested, legal measures were taken against him and he was referred to the public prosecution."
State television broadcast segments about the incident that included the controversial video clip, but with the banner blurred.
The umrah is a pilgrimage that can be undertaken at any time -- distinct from the hajj, which takes place once annually and usually draws millions from around the globe.
The queen died on Thursday and her funeral is planned for September 19.