Tens of thousands of supporters of a Pakistani Islamist executed for gunning down a liberal governor gathered for his funeral on Tuesday, sparking fears of violence, as schools closed and police cordoned off flashpoints.

Main junctions and sensitive buildings in the capital Islamabad and the nearby garrison city of Rawalpindi were guarded by thousands of police, who also lined the route taken by Mumtaz Qadri's funeral procession.

An AFP reporter at the Liaquat Bagh ground, where the prayers were being held, estimated around 50,000 men had turned out by the afternoon.

A few hundred were seen carrying sticks as they shouted slogans including "Qadri, your blood will bring the revolution" and "The punishment for a blasphemer is beheading".

A UN official said all its staff had been sent home from various locations in the capital due to security fears, including from the tightly guarded diplomatic enclave.

Qadri, a police bodyguard to Salman Taseer, shot the liberal Punjab governor 28 times at an Islamabad market in 2011.

He said he was angry at the politician's calls to reform the blasphemy law.

Blasphemy is a hugely sensitive issue in the Islamic republic, and Qadri was hailed as a hero by many conservatives eager to drown out calls to soften the legislation.

Critics say the law - which carries the death penalty - is largely misused, with hundreds languishing in jails under false charges.

Those who carry out extra-judicial killings of alleged blasphemers largely escape punishment.

Key moment  

Analyst Amir Rana said the execution marked a key moment for Pakistan in its more than a decade-long fight against religious extremism.

"I think it is a very critical moment in the political history of Pakistan. It is the first time the political government has made such a decision.

"The resolve is on the rule of law and they will not allow the space for extremism in Pakistan."

But he warned there was potential for the move to backfire by making Qadri a martyr among his supporters and his execution a rallying cry.

Several supporters took turns to denounce and threaten the government prior to the funeral.

"The chief justice, the army chief and the president should fear the day when every single individual of the country will become Mumtaz Qadri and grab them on the streets of the country," said Khadim Hussain.

Muhammad Ghias said he had travelled from the northwestern town of Mansehra because he believed attending the funeral would send him to heaven.

Mourners travelled from distant cities, including Karachi and Lahore.

Pakistan's media meanwhile maintained a near-blackout for the second day running, a move that analysts said so far has helped limit the fallout from the execution.

Thousands protested in cities across Pakistan on Monday after authorities announced the hanging had taken place early that morning.

But with security stepped up at flashpoints across the country of some 200mn, most dispersed peacefully.

"We have manned all the main junctions close to the procession route and sensitive buildings," a police official in Islamabad told AFP earlier on Tuesday, adding that up to 3,000 officers were on the streets.

Many schools and universities remained closed for the day after shutting early on Monday.

A police official in Rawalpindi said similar numbers were deployed there, including hundreds brought in from other districts as well as paramilitary Rangers.

Liaquat Bagh, the park in Rawalpindi where the funeral ceremony will be held, is tinged with political significance: it is where Pakistani prime minister Liaquat Ali Khan was assassinated in 1951, and the site of former prime minister Benazir Bhutto's assassination in 2007.