ISLAMABAD, Pakistan — Dr. Faisal Ranjha was examining a patient in the crowded critical-care unit of his hospital in northeastern Pakistan when a federal officer abruptly walked in, seized his cellphone and told him he was under arrest.



Officers took him home to scoop up his laptop and the tablet computer on which his 8-year-old son was playing games, then drove the doctor more than 150 miles to the Federal Investigation Agency headquarters in Islamabad. Only then was he told why: He stood accused of leading an anti-army information campaign on Twitter.

Dr. Ranjha is one of dozens of people arrested and investigated since January for their social media use, under the sweeping cybercrimes law passed by Parliament last year.

The law, the Prevention of Electronic Crimes Act, was widely promoted as a tool to punish internet activity by banned militant groups and curb online sexual harassment. But in recent months it has increasingly been used to crack down on those who have gone online with criticism of the government and, particularly, the military.