He had his wife and two children with him, using them as human shield against any police action. Zamurd Khan of Pakistan People's Party went to the man as a sympathiser but suddenly jumped at him but could not overpower him.
However, police commandoes already in position nearby opened fire and shot him in the leg. He first raised his arms and then fell down and was arrested.
His wife and two children were safely released, as the high drama ended after about six hours.
The man, who belongs to Hafizabad area of Punjab province, made several demands, including the imposition of Shariah or Islamic law and removal of the government before his arrest.
He said he should be given safe passage to leave the area.
He was also heard saying that he wanted to negotiate with the Prime Minister.
Interior Minister Chaudhry Nisar Ali Khan earlier asked police to try to capture the man alive without harming his wife and children.
The media quoted police as saying that the man had a history of drug and alcohol abuse and was not mentally sound.
Some reports said he was violent to his wife and children. Analysts said the incident raised serious questions about security in the heart of Islamabad. Noting that the man was engaged in a standoff with police less than a kilometre from key buildings like the presidency and parliament, they questioned how the man had been able to enter Islamabad's "Red Zone" with weapons.
The incident also raised serious question about the PML-N goverment to handle such situations, analysts said.