A South African school was Monday accused of racism for allegedly telling black girls to straighten their hair and not wear 'afro' hairstyles.

Pupils at Pretoria High School for Girls have said they were forced to chemically straighten their hair and not have afros that were deemed untidy.

Over the weekend, students donning afro hairstyles and braids held a protest at the school to voice anger against the long-standing rule.

Politicians quickly weighed in on the row, with the Economic Freedom Fighters (EFF) party accusing the school of seeking "to directly suppress blackness in its aesthetics and culture".

Mmusi Maimane, leader of the main opposition Democratic Alliance party, tweeted: "My daughter has an Afro... Would she not be allowed at (Pretoria) girls?"

On Monday, Panyaza Lesufi, the minister of education department in Gauteng province, visited the government-run school for talks with senior staff and students.

"I really want to arrest the situation before it gets out of control," Lesufi told reporters.

An online petition against the school's alleged policy has gathered more than 10,000 signatures since it was created on Friday.

The petition, titled "Stop Racism at Pretoria Girls High", calls on authorities to ensure that the "school's code of conduct does not discriminate against black and Muslim girls".

"We are being discriminated against because of our hair, they want us to relax our hair, they want our hair to look a certain way," an anonymous student told the PowerFM radio station.

The prestigious school in the capital Pretoria was historically attended by whites only but now admits black children following the end of apartheid in 1994.

South Africa is still grappling with racial issues 22 years after the end of white-minority rule.

Black students at the school also alleged on social media that they were not allowed to speak ethnic languages to one other.

Disagreements over students' hairstyles have previously erupted in South African schools, with some parents accusing education authorities of racism.