peshawar school attack
A man carries an injured girl after the attack by Taliban militants. A Majeed/AFP

The attack on a military school in the Pakistani city of Peshawar is over after authorities killed all of the Taliban militants, according to police reports.

Local police told AFP news agency that all six Taliban militants were killed by security forces, ending the attack.

At least 130 people, mostly children, were killed in the massacre and 122 injured after at least six militants - dressed as security forces - entered the building shooting at students and detonating at least one suicide bomb.

A three-day period of mourning has been extended nationwide by Pakistani Prime Minister Nawaz Sharif.

It is believed that the attack was motivated by Pakistani military operations against the group and most of the 500 students at the school have been evacuated from the premises.

A Taliban expert said that there was also a possibility that the school was targeted because education activist Malala recently won the Nobel Peace Prize.

Education activist and Nobel peace prizer winner Malala Yousafzai condemned the "atrocious and cowardly" attack on the Pakistan school.

"I am heartbroken by this senseless and cold-blooded act of terror in Peshawar that is unfolding before us" she said. "Innocent children in their school have no place in horror such as this.

"I condemn these atrocious and cowardly acts and stand united with the government and armed forces of Pakistan whose efforts so far to address this horrific event are commendable.

"I, along with millions of others around the world, mourn these children, my brothers and sisters - but we will never be defeated."

Pakistani Prime Minister Nawaz Sharif said that the attack was a "national tragedy" while Pakistani opposition leader and former cricket captain Imran Khan said it was "utter barbarism".