Egypt's President Abdel-Fattah el-Sissi has ratified much-contested legal amendments that effectively give him power over the country's courts, as he will be the one appointing heads of judicial bodies.

Those judicial bodies include the Court of Cassation, which was seen as a last refuge for political prisoners.

Rights groups condemned the law after parliament passed it Wednesday. El-Sissi ratified it Thursday and the official Gazette carried the presidential ratification to the so-called Judiciary Commissions Amendments.

Najia Bounaim, North Africa campaign director at Amnesty International, says: "This law has the potential to undermine the independence of the country's already beleaguered judiciary." The group had warned the president against ratifying it saying it would be a "setback to justice."

Previously, the president only confirmed judges' choices of the heads of judicial bodies.