A Minnesota school district has agreed to pay $70,000 to settle a lawsuit that claimed school officials violated a student's constitutional rights by viewing her Facebook and email accounts without permission.

The lawsuit, filed in 2012 by the American Civil Liberties Union of Minnesota, alleged that Riley Stratton, now 15, was given detention after posting disparaging comments about a teacher's aide on her Facebook page, even though she was at home and not using school computers.

The ACLU also said administrators viewed her online conversations between the then-Minnewaska Area Middle School sixth-grader and a boy because of a complaint the two were using computers to talk about sex.

“I was in tears,” Riley told the Star-Tribune on Tuesday. “I was embarrassed when they made me give over my password.”

After a parent complained about the Facebook chat, the school called her in and demanded her password. With a sheriff deputy looking on, she complied, and they browsed her Facebook page in front of her, according to the report.

More On This... Five Facebook problems you need to fix right now

"It was believed the parent had given permission to look at her cellphone," Minnewaska Superintendent Greg Schmidt said Tuesday. But Schmidt said the district did not have a consent form signed by the parent. That is now a policy requirement, he said.

Wallace Hilke, an ACLU attorney who helped lead Riley's case, told the Star-Tribune that students' use of social media is not the school's business unless it involves cyberbullying or poses a substantial threat to school activities.

"They punished her for doing exactly what kids have done for 100 years -- complaining to her friends about teachers and administrators," Hilke said. "She wasn’t spreading lies or inciting them to engage in bad behavior; she was just expressing her personal feelings."

Riley's mother, Sandra Stratton, told the newspaper she wasn't informed or invited to sit in when officials “interrogated” her daughter.

"They never once told me they were going to bring her into the room and demand her Facebook password," Sandra said. "I’m hoping schools kind of leave these things alone so parents can punish their own kids for things that happen off school grounds."

Riley said she is happy the case is over and that the school has changed its rules. She said the experience was embarrassing and hard to go through, but that schools elsewhere will hear about the case and will not punish other students the way she was disciplined.

She fell behind on schoolwork because she was too distraught and embarrassed to attend school, according to the lawsuit, which sought unspecified damages and an order that would stop school officials from attempts to regulate or discipline students based on speech made outside of school hours and off school property.

Schmidt said the fact that the posting occurred at home was a factor in settling the case.

"There's lots of questions about whether schools should discipline kids for things that happen out of school," he said.

The $70,000 settlement will be divided between the Strattons, for damages, and the ACLU of Minnesota.

The Associated Press contributed to this report.

Click here for more from StarTribune.com.