Image copyright CBS

A US judge has blocked the suspension of a high school girl who was punished for posting a note at school warning of a "rapist" in their midst.

In September Aela Mansmann, 15, was accused of bullying by school officials in Cape Elizabeth, Maine, after she posted notes in the girls' toilets.

But on Thursday a judge issued a temporary stay on the suspension citing concerns over free-speech rights.

A lawsuit filed by the girl's family against the school is still pending.

The case began on 16 September after Aela posted notes in two bathrooms at Cape Elizabeth High School reading: "There's a rapist in the school and you know who it is."

After another student brought the note to school administrators, they investigated and identified Aela through camera footage.

Image copyright CBS Image caption Aela Mansmann shows the note she posted, leading to her punishment

She and two other girls were suspended for three days on 4 October after officials determined the behaviour constituted bullying.

The district's investigation revealed that one male student felt targeted by the notes and was ostracised by his peers, forcing him to miss classes.

In an interview with CBS, Aela said her note was never intended to single out anyone as a rapist, but was rather highlighting the issue of sexual assault.

The Bangor Daily News reports that after the notes were posted, "the rumour mill spun out of control, creating fear in the high school".

The principal, Jeffrey Shedd, conducted 47 interviews and determined the school was safe, according to the newspaper.

He previously said the three suspended girls had "made a really bad choice", despite meaning well.

The suspension led about 50 students in the 550-pupil school to walk out in protest on 7 October.

The American Civil Liberties Union (ACLU) sued the school district near Portland, Maine's largest city.

It argued that the girl had simply taken a "public stance as an ally for victims and survivors of sexual violence".

In the order temporarily blocking the suspension on Thursday, US District Court Judge Lance Walker cited "a fair likelihood" that the suspension would ultimately be overturned on the grounds of free speech and Title IX - a federal law that bans gender discrimination in education.

The notes, the judge wrote, were "neither frivolous nor fabricated, took place within the limited confines of the girls' bathroom, related to a matter of concern to the young women who might enter the bathroom and receive the message, and [were] not disruptive of school discipline".

In interviews before the judge's order, Aela said she was shocked that the school chose to investigate her rather than the person who alerted school administrators to the note.

"I was really surprised that my school took that report and decided to open an investigation into whether or not I'm a bully versus opening an investigation on whether or not this person who self-identified is a perpetrator," she told Business Insider.

The ACLU praised the decision, saying: "Speaking up about sexual assault is already difficult for young people. If this punishment had been allowed to stand, it would have only made it more difficult."

Shael Norris, the girl's mother, also hailed the decision.

"All my daughter ever wanted was for students to feel safe speaking out about sexual assault," she said in a statement through the ACLU.

"I'm so proud of her for standing up for what she believes in."