A handgun loaded with live ammunition was discovered inside a student’s locker Wednesday morning at Robinson Secondary School in central Fairfax County, authorities said.

Officials said administrators at Robinson received a tip about the weapon’s presence on the property and conducted a locker search in the morning while school was in session. School administrators confiscated the firearm and notified county police.

A girl at the school had complained to friends that she had troubles in her neighborhood, Dee Haas, president of the Robinson PTSA, said in an interview, and a second girl brought a handgun from home to give to her friend.

“She thought she was doing a favor,” said Haas, who added that she was on campus when the incident occurred.

Haas said the distressed teenager had no plan to wield the pistol on Robinson property and wanted to use it to solve her troubles outside of school.

The weapon was discovered after another female student learned about the gun being stored in a locker and alerted school officials, Haas said.

“I give full credit to the student who came forward,” said Haas, the mother of a 10th-grader at Robinson. “She was afraid of what was going to happen with her friend, and she trusted the school to help her out of it. This was an example of students taking ownership and making sure their schools are safe.”

Officer Don Gotthardt, a county police spokesman, said officers were called to Robinson at 7:10 a.m. in response to the tip about the gun, said to be in a 13-year-old female student’s locker.

Gotthardt said Thursday that nobody had been arrested in connection with the incident. Police declined to discuss how the girl who brought in the gun might have obtained it or whether any adults were under investigation in connection with the incident.

“This case is being handled administratively, but that doesn’t preclude the possibility of criminal charges,” Gotthardt said. In a letter to Robinson parents, Principal Dan Meier wrote that multiple students involved have been identified by authorities.

Under Fairfax school rules, students who bring a firearm to school are likely to be suspended for 10 days and may be expelled for at least a year.

The caliber of the weapon was not known, but officials confirmed the pistol was not a pellet or BB gun. Officials said Robinson students were never in any imminent danger during the incident. Haas said most students learned of the gun on campus hours later from their parents.

Gotthardt called finding a gun on a school campus in the county an “extremely infrequent” occurrence and said he could not remember a similar incident this year.

Robinson, on Sideburn Road in Fairfax, operates as a middle and high school for students in grades 7-12. Its total enrollment is about 2,600 students.

In Montgomery County on Thursday morning, a 17-year-old student at Magruder High School in Rockville was arrested and charged as an adult with weapons offenses on school grounds, police said.

Police said Octavio A. Estevez of Southeast Washington was charged with possession of a weapon on school property and other counts after a school resource officer spotted him on school grounds shortly before 8 a.m. and noted that he was not supposed to be on the property.

When the officer asked Estevez to leave, police said, he refused and was arrested for allegedly trespassing. An unloaded .22-caliber handgun was found after a search of Estevez’s backpack, police said. The gun was described as “older,” and it was unclear whether it still worked.

David Marino-Nachison contributed to this report.