A Minnesota school subjected an 8-year-old boy to a body cavity “strip” search to find out if he pooped on a bathroom floor, a new lawsuit claims.

An attorney for the boy’s mother said the invasive incident happened during the spring of the 2017-18 school year at Countryside Elementary School in Edina left the child – who was then in second grade — traumatized with extreme mental and emotional distress.

“This situation is certainly bizarre; it’s unusual and perhaps unique,” attorney Marshall Tanick told KMSP. “The school district has a policy that says parents will be informed of any action like this before it takes place. The parents weren’t informed before, during or after it took place.”

The boy, who no longer attends the school, was probed by unidentified staffers to determine whether he had defecated on a bathroom floor, according to the lawsuit, which seeks damages in excess of $50,000.

The “excessive, unnecessary, unreasonable and unwarranted” search took place without notifying the boy’s parents and without probable cause since the child had “not committed the defecation,” according to the filing.

The lawsuit claims Edina Public Schools also refused to provide the boy’s mother with a full report about the incident.

A spokeswoman for Edina Public Schools said the district would be unable to comment on pending litigation, but denied the allegations, characterizing them as “inaccurate” and misleading.

“District staff acted to support this student, and it is unfortunate that this matter has progressed to this point based on significant misunderstandings of the district’s actions,” district officials said in a statement to The Post.