Children in Rio de Janeiro will have to identify their blood type on school uniforms due to new regulations.

The law was passed last Monday (October 31) in response to growing violence in the city which has claimed the lives of over 3,000 people this year. It is hoped that the new identifier will help children caught up in the cross fire between gangs and police.

The law was first proposed by councilman Renato Moura last year but was challenged by the City of Rio which claimed the measure was unnecessarily invasive. A review by a court of appeal has upheld the constitutionality of the law.

Judge Gabriel de Oliveira Zefiro said during the court session that the law was reasonable and logical, newspaper O Dia reported.

"With so much violence that causes the closure of schools, the measure is important and does not generate much cost for the Public Power," he said.

In October, 12,353 children were unable to attend classes after 37 primary and secondary schools in the district closed over concerns about student safety.

When defending his motion in 2015, Councillor Moura stated that the law would help facilitate medical emergency services who treated young victims.

"The adoption of this measure will facilitate the assistance to students in the event of an emergency, thus contributing to the different professionals of the health area can effectively carry out their relief activities," he wrote.

The regulations state that children must now affix identification of their blood type and Rh factor to the right side of their upper body. The identification can be attached to jackets, shirts or t-shirts and must be permanent and durable. Both private and public schools of all age levels will be required to comply with the law.

Young people and students have inevitably been caught up in violence across the state. In March a 13-year-old girl was killed after three bullets struck her while she was participating in physical education class outside at a school in the north of the city.