OAKLEY -- A dangerous plan that unfolded over a social networking site late Wednesday left a teenage girl with potentially serious head injuries after she was attacked by two other students in Freedom High School's cafeteria Thursday.

Principal Erik Faulkner said the two students, whose names, ages and grade levels have not been released, bumped into each other in a school hallway Wednesday and words were exchanged.

Though the girls walked away from each other, one of the teens remained angry and later started a war of words with the other girl on the networking site Instagram, which allows users to post messages and photos and share them on Twitter and Facebook.

As the angry messages intensified, one of the girls started separately corresponding with friends, planning an attack on her classmate, Faulkner said.

About 11:30 a.m. Thursday, the instigator and one of her friends attacked the other girl in the cafeteria during the lunch break.

The victim fell and hit her head during the assault, Faulkner said, but was able to stand up and walk to the front office, where she was talkative and coherent.

But her condition soon worsened, and police and paramedics were called, Faulkner said.

As paramedics were wheeling the student out to the ambulance, they determined her injuries were more severe than originally thought.

The student was taken by helicopter to John Muir Medical Center, where she was undergoing tests Thursday evening and was being monitored by doctors.

The extent of her injuries was unclear.

The girl who attacked her was arrested on suspicion of felony battery, said Oakley police Chief Bani Kallo. A second girl was detained for questioning but later released, Kallo added.

Faulkner said the incident does not appear to be gang-related.

"I don't have the power to go to (Facebook founder Mark) Zuckerberg and ask him to maybe shut something like this down," Faulkner said of posts he had seen that were part of the planning process of the attack. "Today, there is no time for reflection. Social media is not the proper way to deal with a situation."

Faulkner plans to speak with the student body about the attack and said he and his staff will work with students to look at why social media is an inappropriate way to handle misunderstandings and arguments.

"Once you post something online, it stays there forever," Faulkner said. "People may not be willing to say something in person so they say it in things like text or email. Tone and context are lost."

Contact Katie Nelson at 925-945-4780 or follow her at Twitter.com/katienelson210.