President Asif Ali Zardari, who was in Dubai for nearly two weeks for medical treatment, will leave the emirate shortly to return to Pakistan, his spokesman said on Sunday night.

Zardari's medical treatment triggered speculation the deeply unpopular president, who has uneasy relations with Pakistan's powerful military, might resign.

The president is in the plane, and he is about to leave for Pakistan, Farhatullah Babar told Reuters.

Zardari could be damaged by a controversial memo, allegedly crafted by the former U.S. ambassador to the United States, accusing the military of plotting a coup.

Businessman Mansoor Ijaz, writing in a column in the Financial Times on October 10, said a senior Pakistani diplomat had asked that a memo be delivered to the Pentagon with a plea for U.S. help to stave off a military coup in the days after the bin Laden raid.

Ijaz later identified the diplomat as Husain Haqqani, the then Pakistani ambassador to Washington who is close to Zardari.

Haqqani denied involvement in the memo but resigned over the controversy gripping Pakistan.

Army chief General Ashfaq Kayani has called for an investigation into the memo. On Monday, Pakistan's Supreme Court is due to start hearings into a petition demanding an inquiry into who was behind it.

(Reporting by Sheree Sardar; writing by Michael Georgy; editing by Philippa Fletcher)