LAHORE, Pakistan — The arrest of a confessed serial killer who used the Internet to lure his victims has caused alarm among gay men and lesbians in Pakistan, where social media has been quietly used to widen freedoms in a country where homosexuality is illegal.

Police officials in the eastern city of Lahore said the man, a paramedic named Muhammad Ejaz, was under arrest on suspicion of killing three men he had met on Manjam, a social networking website for gay men that has thousands of members in Pakistan.

Investigators said Mr. Ejaz, 28, had made a full confession since being arrested in a police sting operation last week. He told officers that he had met the victims, including a retired army officer, at their homes, drugged them with sedatives hidden in food and strangled them.

News of the arrest caused Manjam to announce on Sunday that it was closing its website to nonmembers in Pakistan until further notice, citing security and privacy concerns.