A Pakistani politician was hailed as both a hero and a reckless fool after trying to disarm a gunman demanding the imposition of Islamic law, during a bizarre standoff with police in Islamabad.

The six-hour drama, given blanket coverage by Pakistan's news channels, began late on Thursday afternoon when Mohammad Sikandar began firing into the air with two assault rifles on the main avenue of the capital.

Sikandar had been driving his car with his wife and two children the wrong way down the road at a time of heightened security precautions when he was stopped by traffic police.

Pakistanis watching the extraordinary rolling live television footage of the gunman wandering around, smoking and drinking energy drinks, took to social media, divided over whether the police should have tried to take a shot at the man or to persuade him to surrender.

Sikandar and his wife gave telephone interviews to news channels. Islamabad's police chief said the gunman was demanding the resignation of the government and fresh elections held under Islamic law.

While his words echoed the all-too familiar rhetoric of militant groups – a Pakistani Taliban commander even attempted to claim credit for the stunt – it appeared the man was mentally unstable.

The drama came to a head when the former MP Zamurd Khan – who had presented himself as a volunteer negotiator – lunged at the gunman and tried to overpower him.

The manoeuvre was only partially successful as Sikandar moved away, fired a round, appeared to surrender and then started running. He was then shot by police, some of whom indulged in celebratory aerial fire.

Sikandar was taken to hospital, where he remains in critical condition.

Amid much criticism of the police for allowing the episode to drag on in an area close to some of the government's most sensitive areas, many viewers hailed Khan's intervention as a bold move. Others said he had been needlessly reckless. Rana Sanaullah, the law minister of Punjab province, concluded that Khan was guilty of an "act of stupidity".