The victim, 15, died of a single gunshot wound and authorities said they do not believe anyone else was in the bathroom when the student died.
Immediately after the incident, which took place at 8:35 a.m. Monday, school officials put the intermediate school and neighboring high school on lockdown. Classes were canceled at the intermediate school, though they are expected to resume Tuesday, district Superintendent Jeff Holmes said.
The school is not equipped with metal detectors.
"Unfortunately a life was lost, but it could have been a lot worse," Coweta Police Lt. Donnie Krumsiek said.
Coweta is 25 miles southeast of Tulsa, Okla.
Parents were notified of the incident via a mass phone call, Holmes said.
Fellow ninth-grade classmates of the student gathered in a gymnasium where counselors were available to comfort them, as they waited for their parents to pick them up.
"We're just going to be available for one another," Holmes said. "We are a small community. We're going to get through this together."
Exploding whale video goes viral on Internet
Caroline Berg Eriksen: Soccer player's wife triggers debate with post-birth selfie