Ms. Sharif was arrested while visiting her father, the former prime minister Nawaz Sharif, at a jail in the city of Lahore, where he is serving a sentence for corruption. She had already been scheduled to appear before the anticorruption authorities on Thursday in relation to her family’s ownership of a sugar mill. Officials said she was arrested in connection with that case, but did not provide further details.

The Sharif family, which dominated the country’s politics for decades, has faced several corruption inquiries since the Supreme Court disqualified Mr. Sharif from office in July 2017. Its members have all denied wrongdoing, insisting that the charges are politically motivated and pushed by the country’s influential military, with whom Mr. Sharif often clashed.

Politicians in Pakistan are regularly accused of stealing or misusing public funds. Mr. Khan has repeatedly vowed to stamp out corrupt practices and arrest anyone involved, but many critics say he has used the anticorruption campaign to silence criticism of his handling of Pakistan’s economic troubles and foreign policy.

Mr. Zardari, the lawmaker who led the walkout in Parliament, said on Thursday that the arrest of Ms. Sharif was a divisive step at a time when the country’s political class needed to show unity over India’s move to eliminate the autonomy of the disputed region of Kashmir.

“While we are condemning Modi,” he said, referring to the Indian prime minister, Narendra Modi, “it is unfortunate that our prime minister cannot control his ego and arrogance. He is doing a politics of revenge.”