Egyptian police have used water cannon and tear gas to disperse several thousand demonstrators in Cairo protesting against a court's ruling to dismiss a case against former president Hosni Mubarak over the killing of protesters during the 2011 uprising against him.
Demonstrators scattered into side streets as security forces moved in to break up the gathering, which began near Tahrir square after a judge dismissed the charges against the former president.
The move by security forces came shortly after members of the banned Muslim Brotherhood group joined the protest.
An Interior Ministry statement said that Brotherhood supporters pelted security forces with rocks and fought with the protesters.
Mubarak's 29-year-old regime was toppled by the 2011 uprising.
About 2,000 young people protested against the verdict near Tahrir Square, the birthplace of the 2011 uprising closed off by soldiers and police, though open a day earlier despite widespread fears of violent Islamist protests. They chanted against the military, whose former chief, Abdel-Fattah el-Sissi, is now the president.
"The people want to bring down the regime!" they shouted, using one of the chief slogans in the 18-day, anti-Mubarak uprising.
Security officials said police arrested 29 people.
The dispersal of the protesters contrasted with the jubilant well-wishers who greeted Mubarak after the decision when he returned to his temporary home at a Nile-side military hospital. He later triumphantly waved back to supporters from his hospital window.
A television interviewer reached him by telephone, asking whether he had ordered the killing.
"I did not do anything at all," replied Mubarak, who was convicted and sentenced to life in prison in 2012 on charges related to the killing of protesters. The verdict was overturned on appeal the following year.
The monarch of close US ally Bahrain, King Hamad bin Isa Al Khalifa, also called to congratulate Mubarak, according to the official news agency of the Gulf Arab island nation.
Mubarak, who assumed Egypt's highest office in 1981 following the assassination of Anwar Sadat, has spent virtually all the time since he was detained in April 2011 in hospitals due to poor health. He came to the courtroom on a stretcher, wearing dark glasses, a navy blue tie and a matching cardigan.
In his ruling, judge Mahmoud al-Rashidi cited the "inadmissibility" of the case against Mubarak due to a technicality. He said Mubarak's May 2011 referral to trial by prosecutors ignored the "implicit" decision that no criminal charges be filed against him when his security chief and six of his top aides were referred to trial by the same prosecutors two months earlier.
After the decision, Cairo resident Nermine Fathy simply asked: "Who killed the martyrs? I want to know who killed the martyrs."
That question will probably not be answered in Egypt's courts. Already, nearly 170 police officers and security officials put on trial in connection to the killings have either been acquitted for lack of evidence or were found to have acted in self-defence. Some received short, suspended sentences.
The Mubarak trial, however, was concerned only with the killing of 239 protesters whose names were cited in charge documents, not the nearly 900 killed in total during the 18 days of the revolt.
The ruling marks another major setback for the young activists who led the 2011 Egyptian uprising, many of whom are now in prison or have withdrawn from politics.
It likely will reinforce the perception that Mubarak's autocratic state remains in place, albeit led by Mr el-Sissi, the former military chief who later led the overthrow of Islamist president Mohammed Morsi in 2013.
It concludes Mubarak's retrial along with his two sons, his security chief Habib el-Adly and six top security commanders, who were all acquitted. Also acquitted was wealthy businessman Hussein Salem, a long-time Mubarak friend tried in absentia.
Hossam Bahgat, a prominent human rights advocate, said the verdict would be used by the government to signal the end of the upheavals associated with the 2011 revolt.
"The regime's message - it's time to look forward, time to move on, time to focus on building the nation. But I doubt this will work. It will deepen the grievance and feeling of injustice felt by many young people," he said.
Mubarak was also acquitted of corruption charges that he faced along with his sons Alaa and Gamal - his one-time heir apparent - over the statute of limitations in the case running out.
The case involves their purchase from Salem of luxury villas in a Red Sea resort at a vastly discounted price, something that the prosecution had said amounted to bribery. The two sons face a separate trial on charges of insider trading.
All the rulings can be appealed.
It was not immediately clear whether Mubarak would now walk free since he is serving a three-year jail term for separate corruption charges he was convicted of in May. He has been in detention since April 2011, but it is unclear if the past three-and-a-half years will be treated as time served.
Mr Al-Rashidi, the judge, said the dismissal of the charges did not absolve Mubarak of the corruption and "feebleness" of the latter years of his 29-year rule. The judge praised the 2011 uprising, saying that its goals - freedom, bread and social justice - were legitimate.
He also said Mubarak, like any other human, erred at times and suggested that his old age should have spared him a criminal trial.
"To rule for or against him after he has become old will be left to history and the Judge of Judges, ... (God), who will question him about his rule," the judge said.