An exclusive private school in New Zealand has come under fire for banning students from wearing the hijab.

The Diocesan School for Girls, in Auckland, allegedly told Muslim pupils who wanted to wear the headscarf that it was not part of the school dress code.

The ban has come to light less than a week after Australian terrorist Brenton Tarrant allegedly targeted two mosques during Friday evening prayers, killing 50 Muslims.

In a statement to the New Zealand Herald the Diocesan's principal Heather McRae, claimed the school celebrated diversity and inclusion but the uniform policy '(created) a sense of oneness and family.'

The Diocesan School for Girls principal Heather McRae with Prime Minister Jacinda Ardern

The newspaper stated that ban may contravene the Human Rights Act and the New Zealand Bill of Rights.

Ms McRae stands by the ban, claiming the regulations are in place to 'ensure the Diocesan identity is upheld.'

She told staff at a briefing that the policy was not new and that she expected staff to enforce the rule.

She continued, saying 'no wearing of jewellery or nail polish, skirt length, a requirement to tie back long hair and wear the school blazer outside school grounds, shoe styles and so on.

'All parents sign up to the uniform policies when they join the school.'

An unidentified member of staff told TRT World that the school staff were told the dress code allowed small religious or cultural items, such as crosses, to be worn underneath uniforms.

The exclusive private school in Auckland (pictured) allegedly told Muslim pupils who wanted to wear the headscarf that it was not part of the school dress code

The teacher also revealed that two students were told that their hijab was against the policies of the 100-year-old school, when they had made inquiries.

The teacher then claimed, 'there was just silence [by the teachers]. I got the feeling that people were shocked this was a thing.'

He said a student first learned of the hijab policy was asked to read her poem about Islamophobia at a school assembly this week after the attacks.

The ban has come to light less than a week after Australian terrorist Brenton Tarrant allegedly targeted two mosques during Friday evening prayers, killing 50 Muslims (stock image)

The poem, 'Living beneath the veil', was published on the school's blog two days ago but has since been removed.

The Herald, however, has obtained a copy of the poem by the Year 12 student which is about the abuse Muslim women endure throughout their lives.

Just days ago, in a move largely praised across the world, Prime Minister Jacinda Ardern donned a hijab when she visited the two mosques targeted in the terror attack.

In a statement to the Herald a spokeswoman said: 'The hijab has never been banned at Diocesan. It is simply not part of the long standing school uniform code and there has never been a formal request from a family to have changes made to include it.'