A court that charged a 13-year-old boy for burping in class has defended the ruling and said the arrest was justified.

A federal appeals court in New Mexico upheld the misdemeanour petty arrest of the student, who made other students laugh as he repeateldy belched in physical education class.

The New Mexico law prohibits anyone from interfering in the education process. They also granted the police officer and educators involved with immunity, as reported by The Guardian.

The boy, who has not been named, was arrested in May 2011 at Albuquerque’s Cleveland Middle School.

His mother, who also remains unidentified, filed a lawsuit against the school’s principal and the police officer who escorted him to the police car, put him in handcuffs and took him to a juvenile detention centre.

The boy was held for an hour before his mother arrived. She said the arrest was unlawful and resulted in excessive force.

“At worst, [the boy] was being a class-clown and engaged in behaviour that would have subjected generations of school boys to an after-school detention, writing lines, or a call to his parents,” her complaint read.

Her son had been sent out of physical education class but had continued to burp in the corridor, reportedly leaning through the door so his classmates could still hear him.

Arthur Acosta, the school’s resource officer, was called to the hallway.

The boy disputed the story provided by the teacher, Margaret Mines-Hornbeck, before he was take away to the school’s administrative office and then to the patrol car.

He was suspended for the rest of the school year.

His mother also brought forward a separate complaint that her son had been been subjected to an unlawful strip search in November that year, when a school official suspected he might be carrying marijuana - they did not find drugs on him.