ISLAMABAD, Pakistan — Speculation about the political fate of Pakistan’s embattled prime minister, Nawaz Sharif, was swirling on Thursday after he left the country in the middle of an unfolding scandal over his family’s offshore wealth.

Opposition politicians have pressed Mr. Sharif to resign after the so-called Panama Papers document leak revealed that three of his children controlled shell companies through which they owned expensive residential properties in London. Demands have picked up for a judicial commission under the country’s chief justice to investigate any potential wrongdoing by the prime minister and his family.

Mr. Sharif has rejected any allegations of money laundering, claiming that his children have legitimate business abroad, and he has signaled his willingness to establish an inquiry commission.

But as the political turmoil increased, Mr. Sharif flew to London on Wednesday for cardiac medical treatment that he described as a checkup. The timing of the visit immediately prompted rumors that Mr. Sharif might not return to Pakistan until investigations were completed.