The man, a Yemeni national, on Monday shared a video recording of himself on social media at the Grand Mosque in Mecca, Islam's holiest site, where non-Muslims are barred.
In the clip, he put up a sign saying: "Umrah for the soul of Queen Elizabeth II, we pray God to accept her in heaven and among the righteous."
And while it is permitted to do umrah on behalf on departed Muslims, this does not apply to non-Muslims like the queen.
According to a statement released by Grand Mosque authorities and broadcast by state media late Monday.
"He was arrested, legal measures were taken against him and he was referred to the public prosecution."
State television showed pieces about the incident that included the disputed video clip, but with the banner blurred.