CAIRO — The two sons of former President Hosni Mubarak of Egypt were acquitted on Saturday of illicit share trading during the sale of a bank four years before the 2011 uprising that ended their father’s 30-year autocratic rule.

The brothers, Alaa and Gamal Mubarak, and seven others had faced charges of illegally profiting from the process of selling Al Watany Bank of Egypt to the National Bank of Kuwait in 2007.

Both men, who denied wrongdoing, attended the Cairo Criminal Court session on Saturday, which was held at a police academy for security reasons, and heard the verdict acquitting all the defendants. The public prosecution has the right to appeal.

The two, detained after the 2011 popular uprising on corruption charges, were sentenced to three years in jail in 2015, along with their father. In 2014, they were sentenced to four years in prison in a separate case for an embezzlement scheme that involved diverting public funds and using the money to upgrade family properties.