Egypt's justice minister has reportedly resigned a day after he said the sons of cleaners could not become judges, insisting that the judiciary was too "lofty" for such people.

Judges are "lofty and have status", and must come from "a respectable milieu", Justice Minister Mahfouz Saber said in a television interview on Sunday.

“With all due respect to the garbage collector, and anyone else beneath him or above him, it is necessary for the environmental medium where a judge grows to be suitable,” said Saber.

“A judge has his highness and position, he must come from a respectable medium, both financially and morally.”

If a son of a cleaner were to work as a judge, "he would get depressed and won't continue", Saber said.

Critics had taken to Twitter earlier on Monday to call for him to be fired.

"The son of a cleaner can't work in the judiciary. But he can die in Sinai defending you," wrote one user, referring to a military campaign against an Islamist insurgency in the peninsula.

Mohamed ElBaradei, a former vice president, pointed out that international rights charters guarantee freedom of choice of employment.

الإعلان العالمي لحقوق الانسان: "لكل شخص بالتساوي مع الآخرين حق تقلد الوظائف العامة في بلده" عندما يغيب مفهوم العدالة عن وطن لا يتبقي شيء. — Mohamed ElBaradei (@ElBaradei) May 10, 2015

"When the sense of justice abandons a country, nothing is left," he tweeted.

ElBaradei briefly served as vice president after the army overthrew Islamist president Mohamed Morsi in 2013, resigning in protest over the ensuing deadly crackdown on Morsi's supporters.

The judiciary has come under increasing criticism for its harsh verdicts against members of the political opposition, with hundreds of Islamists sentenced to death over violent protests.

Saber's classist remarks were not the first from the judiciary to cause controversy in a country where government figures show at least 26 percent of the population lives below the poverty line.

Last year, 138 prosecution service applicants were turned down because their fathers had not obtained university degrees.

The Egyptian constitution prohibits discrimination based on class or gender.

Last year the deputy head of Egypt's Cassation court told a journalist that the son of a sanitation worker had "no place in the prosecution".

#Egypt’s Minister of Justice not only discriminates based on social class & origin but intentionally violates the Constitution — Marwa Farid (@MarwaMfarid) May 11, 2015

If the minister of " justice " can make such racist comments, the travesty of justice in many of the cases #Egypt shouldn't surprise us — shahiraamin13 (@sherryamin13) May 11, 2015

#Egypt's Justice Minister in a lot of hot water online for stupid elitist remarks. Here's hoping he gets in hot water offline too... — Amir Beshay (@Amir_G_Beshay) May 10, 2015