A 14-year-old female freshman who shot and wounded a fellow student at a West Texas high school before killing herself had planned to shoot her 14-year-old stepbrother before shooting herself, police have concluded.

But that plan was foiled when a 17-year-old junior encountered the armed freshman Thursday in the girls' restroom at Alpine High School, Chief Russell Scown of the Alpine Police Department said in a statement issued Tuesday.

Scown said the girl had brought a 9-millimeter semi-automatic handgun, 18 bullets and an ammunition magazine from home, all concealed in her backpack.

"Investigators have determined that she intended to shoot her 14-year-old stepbrother and then shoot herself while inside the school. Her plan was interrupted when a 17-year-old female, a junior student at the school, entered the restroom," Scown stated. He did not say how investigators determined that the stepbrother was targeted.

The older girl saw the younger girl with the gun, which she raised and aimed at the junior. The 17-year-old ducked and began running as the other girl opened fire, wounding her in the lower body. Officials said later that day that the wound was not life-threatening.

The 14-year-old then shot herself fatally in the head, Scown stated.

Police have not identified the 14-year-old girl, her 17-year-old victim or her 14-year-old stepbrother. Scown did not respond to a telephone message Tuesday from The Associated Press.

Scown said there is no further threat to the 290 students at the school, nor to the faculty and staff.

Interviews of students and faculty led investigators to rule out bullying as a factor in the shooting. The statement did not say why the girl would target her stepbrother.

In another statement to the community, Scown praised the strength and courage of the girl wounded in the restroom encounter. "The actions of this young lady, although unintentional, thwarted a much deeper tragedy," he said.

Alpine is a remote West Texas town of about 6,000 residents about 220 miles southeast of El Paso.