SAN DIEGO – A California mother is suing her daughter’s school because she alleges a strict bathroom policy led to intestinal problems and traumatized the 10-year-old.

Jamie Barkley filed a lawsuit against San Diego’s Loma Portal Elementary School recently after her daughter was sent to the emergency room with bladder and bowel complications. The girl told the doctors she had been restraining herself from going to the bathroom because of a policy at the school in which students were punished for more than two bathroom breaks per year, Fox 5 reports.

MORE NEWS: From Classroom to Consulate Chef: Culinary Student Lands Dream Job at U.S. Embassy in Paris

Barkley’s attorney, Michael Jeandron, told the news site “beginning in the 2013-14 academic school year, Loma Portal Elementary School Principal Glenda Gerde created and enforced a restrictive restroom access policy.

“Students who exceeded the allotted two passes would not be allowed to use the restroom,” he said. “Some students were punished with detention if they exceeded their two restroom passes.”

Barkley told ABC 10 she first discovered the problem when her daughter, then 9 years old, was caught hiding her wet underwear around the house.

“I asked her what was going on and she broke down in tears,” she said.

Barkley was eventually forced to take the girl to the hospital due to stomach pains, and that’s when she realized how serious the problem really was.

“I brought her to the ER, which the doctor suggested, and they did an X-ray and found that she had a blockage of fecal matter up to her ribcage and they had to go in with tubes in her rear end and kind of do an enema,” Barkley told Fox 5.

“Her doctors said her colon had become stretched out because she was holding her pee,” Barkley told ABC 10. “It made me angry, very angry.”

MORE NEWS: Know These Before Moving From Cyprus To The UK

Loma students last summer told ABC 10 that Gerde announced the restrictive bathroom policy at a school assembly, and that in some classes extra bathroom passes could be earned, but in others students were punished with detention if they exceeded two.

Barkley told the news site she confronted Gerde, who “said children just need to learn to hold it,” but the principal denies the claim. Gerde, who was removed from the school last summer, also denies that she announced the new policy at an assembly.

Instead, Gerde alleges only one classroom, and only one teacher, instituted the policy. Gerde alleges she put an end to the two potty pass rule as soon as she was aware of it, ABC 10 reports.

“The claim that I announced a policy at an assembly is absolutely false,” Gerde said.

Regardless, Barkley’s daughter now suffers serious complications that are robbing her of a normal childhood, the mother told Fox 5.

“She doesn’t get to do all the things she used to, like jump on the trampoline because it comes out and she’ll come to me and say, ‘Mom I had an accident. I don’t want to go on the trampoline anymore,’” Barkley said.

And she’s not the only parent who has complained about problems with Loma restroom policy.

“I found out that my daughter had an infection Wednesday,” another parent told Fox 5. “It was caused by her coming home wet from school. Every time I picked her up she’d be wet or smelly.

“I asked her what was going on. She said her teacher wouldn’t let her go to the restroom.”

The father told Fox 5 his daughter has had multiple urinary tract infections.

“I raise my hand and she say, ‘No, not right now,’ then later on it’s too late,” the 7-year-old told the news site.

Jeandron said the school’s policy violates California Education Code.

“It’s time for the school district to take responsibility for the harm they caused while the policy was enacted,” he said.