Image caption
Ahmed Mekky was said to be concerned about a bill to lower the retirement age for judges

Egypt's justice minister has resigned, following demands from Islamist supporters of President Mohammed Morsi for the "cleansing" of the judiciary.

Ahmed Mekky was seen as a supporter of judicial independence during former President Hosni Mubarak's rule.

He threatened to quit last year after the president adopted broader powers.

Thousands of pro-Morsi supporters demonstrated on Friday, calling for those linked to the former regime to be removed from judicial posts.

The protests turned violent as the demonstrators clashed with opponents.

Controversial bill

In his resignation letter, Mr Mekky stated that the rallies earlier this week had led to his decision, Associated Press news agency reports. The presidency has so far not commented on the announcement.

Image caption
President Morsi has faced a range of problems since taking office in June 2012

Mr Mekky was also said to have voiced his concern about attempts to pass a new bill which critics argue would give the Muslim Brotherhood-dominated government greater control over the judiciary.

The bill envisages the lowering of the retirement age of judges - a measure that would mean the forced retirement of some 3,000 judges.

The offer of resignation comes a day after President Morsi announced his plans to reshuffle the cabinet.

Mr Morsi has faced a range of problems since he took office in June 2012 after Egypt's first post-Mubarak presidential election.

As well as a simmering feud with the judiciary, pro-reform protests in Cairo have continued, with deaths during anti-Morsi protests marking two years since the fall of Mubarak.

The president has also been accused of failing to hold officials accountable for alleged crimes carried out during the Mubarak years.

There was a wave of unrest in January after the imposition of death sentences on 21 people over football violence.

Political progress has been slow in Egypt, with parliamentary elections scheduled for this spring now postponed with no new date set.