ISLAMABAD, Pakistan — Pakistan executed seven prisoners on Tuesday, including one who had been convicted of taking part in an attack on an American Consulate, as part of a broader crackdown on militancy after last month’s school massacre in Peshawar.

The hangings, which took place in four prisons under conditions of increased security, coincided with the second day of a visit to Pakistan by Secretary of State John Kerry, who had come for talks on counterterrorism cooperation, economic aid and other issues.

Speaking to reporters in Islamabad, Mr. Kerry said that just as the United States stood by France in the wake of the Charlie Hebdo attack, so it would support Pakistan against Islamist militants, including the Pakistani Taliban, who carried out the Dec. 16 attack on the Army Public School in Peshawar, killing 150 people, most of them children.

Pakistan lifted a six-year moratorium on executions after that attack. Tuesday’s hangings, which were announced by the office of Prime Minister Nawaz Sharif, brought to 16 the total number of executions since the assault on the school.