Pakistan's former prime minister Imran Khan has pleaded not guilty to corruption charges a day after his arrest sparked nationwide protests.
Nearly 1,000 people have been arrested, police say, and eight people have died nationwide in the protests.
There is tight security at the police guesthouse where he is being detained, which is also serving as a courtroom.
The arrest dramatically escalated tensions between Mr Khan and the military at a time of economic crisis.
Conviction would permanently disqualify the former cricket star - prime minister from 2018 to 2022 - from standing for office. Elections are due later this year.
Dramatic footage showed dozens of security officers forcibly removing the 70-year-old from court on Tuesday, then bundling him into a police vehicle.
On Wednesday Mr Khan was indicted on charges that he unlawfully sold state gifts during his premiership, in a case brought by the Election Commission.
He denies the allegations and says he fulfilled all legal requirements.
It was the first of dozens of cases against him in which he has been formally charged.
For months he had avoided arrest, with his supporters at times fighting pitched battles with police to keep him out of custody.
Tuesday's arrest was based on a new warrant for a separate corruption case, connected to the alleged transfer of land for Al-Qadir University, near Islamabad. The judge remanded Mr Khan in custody for eight days in this case.
Mr Khan's Pakistan Tehreek-e-Insaf (PTI) party said he has not had access to legal counsel, and that the party will challenge the legality of his arrest in court.
The action by Pakistan's anti-corruption body has led to violent protests across the country. The army has sent reinforcements to the capital and the country's most populous province, Punjab.
The authorities in Khyber Pakhtunkhwa province have also requested troops be deployed to maintain security.
Extraordinary scenes on Tuesday evening showed Mr Khan's supporters ransacking the corps commander's residence in Lahore, smashing chandeliers and making away with peacocks - among other things - which they said were bought with "citizen's money".
Police in Islamabad used shipping containers to try to block routes through to the compound where Imran Khan was appearing before a judge.
The BBC witnessed clashes between protesters and the police in the middle of one of Islamabad's main motorways.
Protesters began gathering after midday, some carrying with them PTI flags or wearing Imran Khan face masks.
Canisters of tear gas were fired into the crowd soon after they began to gather. The protesters attempted to hit the metal casings away using their sticks. There were no arrests during the 90 minutes the BBC were present.
"We came to do a peaceful protest, but these police are shelling us," one man, who was holding stones and a stick and wearing a surgical mask, told the BBC.
"Until our death we will continue this protest or until they free Imran. Otherwise we will shut the whole country."
Mr Khan was ousted last April, less than four years into his term as prime minister.
In November, he was shot in the leg while campaigning among crowds in the city of Wazirabad.
He has accused a senior intelligence official of carrying out the attack - an accusation strongly denied by the military. A day before his arrest, the military had warned Mr Khan against repeating the allegation.
Mr Khan's party says he faces more than 100 court cases, which he says are politically motivated.
His supporters argue that the current government wants to bar him from contesting general elections due in October.
Dr Shireen Mazari, the former Minister for Human Rights in Mr Khan's PTI government, told the BBC that the way Mr Khan had been detained amounted to state abduction.
"We don't expect even the military to abuse the sanctity of the court in this way," she said, adding that people in Pakistan were "seething with anger" at the way he had been treated, as well as wider economic problems.
However, Islamabad's High Court declared the arrest legal.
"Mr Imran Khan will face the law, if innocent, [he] can contest the election. But if found guilty of corruption, he will have to face the consequence of that," Minister of Planning Ahsan Iqbal said in a press conference on Wednesday.
Police have arrested supporters of Mr Khan's party, including Asad Umar, its secretary-general.
Mobile internet services remain heavily restricted across the country. Pakistan's telecommunication authorities said they had suspended services on instructions from the interior ministry.
Schools also remain closed, some highways have been blocked and there is little traffic on roads in major cities.
Many analysts believe Mr Khan's election win in 2018 happened with the help of the military. But amid a growing economic crisis, observers say he fell out of favour with the powerful military, the crucial behind-the-scenes player in nuclear-armed Pakistan.
Since being in opposition, he has become one of the military's most vocal critics.