Taliban members cut their way through a fence in the campus perimeter to gain access to the students and faculty. Some victims were shot as they fled, and others were rounded up to be executed. Four of the suspected attackers were killed by security forces.

ISLAMABAD, Pakistan — Gunmen slipped into a college campus under cover of fog Wednesday, killing at least 20 people — some shot execution style — in the latest terrorist attack in Pakistan targeting students in apparent revenge for expanding military crackdowns.

The attack, claimed by a Taliban faction, is likely to unite the country behind stern action against Islamist militant groups 13 months after a similar rampage on a nearby army-run school killed about 150 students and teachers.

Four suspected attackers also were killed in Wednesday’s bloodshed, officials said.

Pakistan Prime Minister Nawaz Sharif vowed a “ruthless response,” saying the attack was on all of Pakistan.

“Cowards and their finances will see our national resolve to eliminate terror,” a statement issued by his office said, even as some Pakistani media outlets reported that the death toll could rise from among the dozens wounded.

The assault began about 9 a.m. when at least four gunmen cut through a back fence into Bacha Khan University in Charsadda, about 30 miles from Peshawar.

Death toll in Pakistan suicide bombing rises to 132

Read Next: Death toll in Pakistan suicide bombing rises to 132

“I saw two terrorists standing on the roof . . . They were shouting Allahu Akhbar,” said Basit Khan, a student of computer sciences, referring to an Islamic cry for God is great. “After that, firing started and I and my friends started running. There were people screaming. We were terrified.”

Eyewitnesses told The Washington Post that many of the university students were shot in the head.

Ashfaq Ahmad, a security officer of the university, told the Post that the attackers snuck in through the backyard of the university and “were restricted to the boy’s hostel when security guards opened fire on them.” He said most of the victims were male students. He said a cook and an assistant professor were also among the dead.

“The attackers cut the barbed wire and jumped into the campus. Our guards engaged them and they did not reach the girl’s hostel and main administration block,” he said. He described four attackers around 20 years of age.

Shaukat Yousafzai, a local lawmaker, said preliminary information indicated at least 20 people had been killed. Yousafzai said at least 50 people had been injured, many of whom were suffering from gunshot wounds.

A Pakistani Taliban regional group — Omar Mansoor from Darra Adam Khel region — claimed responsibility for the attack. “We have sent four suicide attackers and they have killed dozens of people,” said a statement by the group, which is also believed to have been behind the Peshawar school attack.

“This is a message to the Pakistani army and civilian leadership, who have executed 130 mujahideen, our people. We will carry out more attacks to take revenge on them,” the group said.

Maj. Gen. Asim Bajwa, a spokesman for the Pakistan military, said security forces converged on the campus and killed four suspected terrorists. Bajwa said a search operation was still ongoing.