Egypt's prime minister says his justice minister has resigned amid outrage over his remark that the sons of rubbish collectors should not become judges.
In a TV interview on Sunday, Mahfouz Saber said judges were "lofty and have status" and had to come from "a respectable milieu".
The son a rubbish collector "would get depressed and would not continue" if he was appointed a judge, Mr Saber warned.
Thousands of people took to social media to express anger at his comments.
In those few words, Mr Saber encapsulated the system of patronage and privilege that brought so many Egyptians onto the streets back in 2011 to bring down Hosni Mubarak and the status quo, says the BBC's World Service Middle East analyst Sebastian Usher.
His dismissal is a small victory for Egyptian liberals but also a bitter reminder for them of how little the system has changed, he adds.
'Slip of the tongue'
Mahfouz Saber faced a storm of criticism on social media, as well as demands for his resignation.
"#Egypt's Minister of Justice says sons of garbage collectors cannot become judges. Yet another proof that justice in Egypt is just a farce," wrote blogger Mina Fayek on Twitter.
Former Vice-President Mohamed ElBaradei meanwhile noted that the Universal Declaration of Human Rights states that everyone has "the right to equal access to public service in his country".
"When the concept of justice is absent from a country, nothing remains," he added.
Prime Minister Ibrahim Mahlab said in a statement that Mr Saber had resigned out of "respect for public opinion".
The minister was quoted in the same statement as saying that the remarks had been "a slip of the tongue".
In Cairo, a large Coptic Christian community of garbage collectors known as Zabbaleen (Egyptian Arabic for "rubbish people") collects by hand and sorts for recycling almost two-thirds of the 15,000 tonnes of rubbish thrown away by the capital's 18 million inhabitants.
Egypt's constitution prohibits discrimination based on class or gender.
However, the AFP news agency says the public prosecution turned down 138 applicants for jobs last year because their fathers did not have university degrees.