CAIRO — The United Arab Emirates arrested an Egyptian presidential candidate to deport him to Egypt, his lawyer said Saturday.

The move against Ahmed Shafik is the strongest indication yet of the length that the United Arab Emirates is willing to go in order to protect President Abdel Fattah el-Sisi of Egypt from any real challenge in his expected campaign for re-election next spring.

Mr. Shafik, a former Air Force general and a former prime minister, has lived in the United Arab Emirates since he narrowly lost Egypt’s only free presidential election, in 2012. He had said in recent days that he intended to run again but the United Arab Emirates had blocked him from travel.

Mr. Shafik, who arrived back in Egypt Saturday night according to security officials, now faces possible treason charges or other legal action in Egyptian courts.