An attack by suspected Taliban militants on a university in north-west Pakistan has killed at least 19 people and injured 50.
Nearly three hours after the attack began, an army official said firing had stopped but troops were searching the Bacha Khan University campus in Charsadda.
The army said four attackers had been killed as the Taliban said four of its suicide attackers were involved.
The Taliban killed 130 students at a school in nearby Peshawar in 2014.
Charsadda is about 50km from the city.
Wednesday's attackers struck about 9.20am local time (5.30pm NZT), reportedly climbing over the back wall, where a university guesthouse is located.
Intense gunfire and explosions were heard as security guards fought the attackers.
"I personally heard two explosions near hostel number one," an unidentified eyewitness told Pakistan's Geo TV.
"We don't know if they were suicide bombers or grenades. I personally saw two explosions and smoke was rising."
Students and staff ran to find cover in toilets and examination halls.
By the time police and Pakistani army commandos had arrived, several students and staff members were dead and dozens of others wounded.
Most of the people on campus have now been evacuated.
Nineteen bodies were taken to a local mortuary.
A Taliban spokesman told AFP the attack was in response to a military offensive against militant strongholds.
An assistant professor at the university, Dr Shakoor, told the BBC he had turned back from the main gate of the campus after being told it was under attack.
Most of the students and members of the faculty would probably still not have arrived when the attack started, he said.
He saw people coming out through the main gate, apparently because the attackers had entered the campus from the back.
The university is located in an open area some distance east of Charsadda, surrounded by open agricultural fields, and is therefore a soft target, BBC correspondent Ilyas Khan said.
Bacha Khan is a new university, founded in 2012, its website says.
Just days ago, some schools in Peshawar were closed by the authorities amid reports that militants were planning an attack.