- 11 updates
Pakistan politician Imran Khan has praised the security guards, police and local citizens for combating a terror attack and "preventing a huge tragedy" at the Bacha Khan University.
Mr Khan also accused the Taliban of "hitting soft targets" because they are desperate.
Former British Prime Minister Gordon Brown has strongly condemned an attack on a university in Pakistan as "heinous, despicable and cowardly".
Speaking to ITV News in Davos, Mr Brown accused the Taliban and other Islamist militant groups of trying to turn schools into "theatres of war".
He called on the international community to condemn the attack and pledge to treat such incidents as a "crime against humanity" which is punishable under international criminal law.
Eighteen students and two members of staff were killed during the attack on Bacha Khan University in Charsadda, according to Pakistan military spokesman Lieutenant-General Asim Bajwa.
Lieutenant-General Bajwa also told ITV News that four terrorists were killed by security forces at the scene.
Nobel-prize winner Malala Yousafzai has said she is "heartbroken by the attack on students and staff at the Bacha Khan University" which may have killed up to 40 people.
In a statement, Malala, who was shot by the Taliban for her views on female education, "strongly condemned" the attack.
The official spokesman for the Pakistani Taliban said on Wednesday that the Islamist movement was not behind the deadly attack on a university that killed at least 19 people.
The written statement by spokesman Muhammad Khorasani came hours after a senior Taliban commander said four of his fighters launched the assault on Wednesday at Bacha Khan University in Charsadda in Khyber Pakhtunkhwa province.
The reason for the conflicting statements was not immediately clear.
A spokesman for the Pakistani Army says the Taliban was behind an attack this morning at a university which reportedly left at least 21 people dead.
The spokesman said the clearance operation has ended, with four gunmen dead.
The militants, using the cover of thick fog, scaled the walls of the Bacha Khan University in Charsadda, northwestern Khyber Pakhtunkhwa province, before entering buildings and opening fire on students and teachers in classrooms and hostels.
A siege at a university in northern Pakistan has ended, with the death toll now reaching 21 people, according to the Agence France Presse news agency.
A security official told Reuters the death toll could however rise to as high as 40 as the army cleared out student hostels and classrooms.
Bodies of students, guards, policemen and at least one professor have been recovered.
The army said firing had ended after several hours and four militants had been killed.
A Pakistani government minister has told reporters at least 20 people have been killed in the attack on a university in north-eastern Pakistan.
Jaag TV reported that Shaukat Yousufzai said the country was facing "international terrorism".
Five people have been in killed in an attack on a university in Pakistan, according to the news agency Agence France-Presse.
A group of militants have stormed Bacha Khan University in the country's north-west.
Police say they have killed two of the militants who stormed a university in northwestern Pakistan, Reuters has reported.
Officers say that most of the students at the Bacha Khan University have been rescued, but some gunmen are still in a campus building.