Police official Arif Khan said gunmen shot and killed four policemen returning to their station from a patrol about 90 kilometers (56 miles) south of Peshawar in Khyber Pakhtunkhwa province.

The victims included the area police chief, his second-in-command and two constables. Jamaat-ul-Ahrar, a breakaway faction of the Pakistani Taliban, claimed responsibility for the attack.

Elsewhere, a pair of gunmen on a motorcycle opened fire on a stationary police van in an upscale neighborhood in the southern port city of Karachi - killing two policemen and wounding two others. Lashkar-e-Jhangvi, another extremist group considered close to the Islamic State group, claimed responsibility for that attack.

Meanwhile, Pakistani authorities detained nearly 20 people Sunday over accusations that they posted “anti-state” content on social media.

The men are facing questioning for posting criticisms of state policies and the Pakistani military, according to two officials at Pakistan’s Federal Investigation Agency. The officials spoke on condition of anonymity because they were not authorized to talk to the media.

They said the men were detained under Pakistan’s cybercrimes law, which prohibits anyone from criticizing or ridiculing the state or its institutions. They didn’t say whether any of the detained men had been formally charged.

An opposition party leader Shah Mahmood Qureshi met the activists in custody. “I met them. They say they haven’t done anything wrong,” he told reporters outside the FIA’s office. “Our constitution tells us to respect the armed forces, but at the same time it also gives us freedom of speech.”