Naila Inayat and Doug Stanglin

USA TODAY

LAHORE, Pakistan — At least 21 people are dead and 23 others wounded after Taliban gunmen climbed over the wall into a university in northwest Pakistan on Wednesday and began firing indiscriminately, according to witnesses and Pakistani officials. At least four gunmen were killed.

The attack, which included explosions, broke out as about 600 people attended a poetry recital at Bacha Khan University, which serves 3,000 students in Charsadda, near the city of Peshawar.

Regional Police Chief Saeed Wazir put the death toll at 21. Other media outlets reported the death toll at 20 to 22.

Army spokesman, Lt. Gen. Asim Bajwa, said on Twitter that four attackers were killed. Pakistani troops were posted on buildings and went block by block to clear the campus, he said.

The attack erupted in the same province as the 2014 Peshawar school attack that killed more than 150 people, mostly children, and shocked the nation. The carnage prompted the Pakistani prime minister to pledge the country will wipe out the "menace of terrorism."

The United States condemned the attack. "It is particularly appalling that these terrorists continue to attack educational institutions, targeting Pakistan’s future generations," State Department deputy spokesman Mark Toner said. "We will stand side-by-side with Pakistan in its fight against terrorism."

Wednesday's attackers got into the compound by climbing over back walls around 9:30 a.m. and opening fire on a security guard. They then made their way to the administration building and the male students' dorms, firing indiscriminately, Wazir said.

"I heard two explosions near the boys’ hostel,” said student Zahoor Khan. “I don’t know if these were suicide attacks or grenade attacks.”

Khan encountered one attacker after leaving the hall where the poetry recital was being held.

“Our organic chemistry professor, Dr. Hamid, warned me not to leave the building after the gunshots,” said Khan, “He was holding a pistol in his hand. Then I saw a bullet hit him. I saw two militants were firing. I ran inside and then managed to flee.”

Attempts to battle the gunmen were complicated by a deep fog that had settled over the area, making visibility difficult for guards to locate them.

“I was on duty on the main gate of the university when I heard gunshots,” said security guard Nur Rehman, who was hospitalized with gunshot wounds. “I rushed to evacuate the hostel and, while I was running, I got shot with bullets and got injured. Due to the fog we were unable to see the terrorists who were firing at us. There was no visibility.”

Basit Khan, a computer science student, said he heard the terrorists through the fog and saw them in classroom buildings.

“They were chanting Allahu Akbar (God is great) when they started firing,” Khan said. “There were attackers in the stairwell and we had no arms to counter them. In the Pashto Department and Computer Science blocks, I saw at least three attackers.”

Botany teacher Mohammad Ishtiaq said he broke his leg after jumping from the second floor of the building when he heard gunshots. Two attackers with automatic assault rifles were on the first floor and three on the ground floor, he said. The students ran in different directions, he said.

"I locked myself in a washroom," he said. "I jumped out when I saw one of the attackers coming toward me and shooting straight ahead of him."

A Taliban leader, Khalifa Umar Mansoor, claimed responsibility for Wednesday's attack, the Associated Press reported. Mansoor was the mastermind behind the deadly December 2014 attack on the Peshawar school.

A spokesman for the main Taliban faction in Pakistan, however, disowned the group behind the attack.

The spokesman, Mohammad Khurasani, said Wednesday’s attack was “un-Islamic” and insisted the Pakistani Taliban were not behind it. Such statements among the Taliban are not uncommon since the group has many loosely linked factions, tje AP reported.

Khurasani said the Taliban “consider the students in the non-military institutions the future of our jihad movement” and would not kill potential future followers. He also said Mullah Fazlullah, the head of the Pakistani Taliban, had nothing to do with the attack.

.

Pakistani Prime Minister Nawaz Sharif was "deeply grieved" over the attack, "which has reportedly resulted into the loss of precious human lives and injured many others," a statement from the prime minister's office read.

"We are determined and resolved in our commitment to wipe out the menace of terrorism from our homeland," Sharif said in the statement. "The countless sacrifices made by our countrymen will not go in vain."

Indian Prime Minster Narendra Modi condemned the attack and offered his condolences to the victims' families.

Stanglin reported from McLean, Va.