Compromising photos of 56 McLean High School girls were carefully organized into folders under each of their names on an online file-sharing account maintained by two of their fellow students, the Fairfax County prosecutor’s office said Monday.

The teenagers, ages 16 and 17, also created elaborate rules for the Dropbox page, which was passed around among teens at the school so they could upload images via a link, the prosecutor said. But in May, a sophomore at the school received the link, and she alerted school officials about the account. Soon, Fairfax police officers were investigating.

The two male teenagers pleaded guilty in Juvenile and Domestic Relations Court in Fairfax County on Monday to three misdemeanor charges each for distributing obscene material, as part of a deal with prosecutors. The Washington Post generally does not name juvenile offenders.

Chief Judge Jannine Saxe sentenced them to two days each in the youth jail and required them to do community service and refrain from using social media and the Internet.

The size and organization of the Dropbox account, surprised parents and the judge.

“Such an elaborate operation is mind-boggling,” Saxe said. “The kind of impact these past behaviors have had on these young women is certainly concerning.”

Dropbox is a cloud-based storage service that allows people to store content in folders on multiple computers or devices that will update simultaneously when connected to the Internet. Files and folders are visible only to those with whom a link has been shared.

Soon after school officials were alerted, Fairfax County Police Detective Nickolas Boffi began investigating the case. Stott said one of the teens charged admitted in interviews with police that he maintained the account and created the rules for it, but he said his friend had originally created it. The friend eventually admitted to police that he had created it.

“My client is a good student,” said lawyer Thomas Abbenante, who represented the teen who wrote the rules for the account. “This is the first time he has been in trouble.”

Nina J. Ginsberg, the attorney for the other teen, said her client did create the account but realized that it was not appropriate and soon stopped participating in it.

The case comes amid renewed concerns in Virginia about the laws that govern sharing of sexually explicit photos and videos by teens. The practice generally falls under Virginia’s child pornography statute, because teens are underage.

A Manassas City teen was charged earlier this year with child pornography counts for “sexting” an explicit video to his girlfriend. In July, police initially obtained a warrant to take a picture of his erect penis to compare to the video, but later backed off after a public outcry.

The teen was eventually placed on probation and the charges will be dropped if he maintains good behavior for a year.

The American Civil Liberties Union of Virginia and other groups have pushed for changes to Virginia’s law so that sexting among teens is not considered child pornography under certain circumstances. The state’s Crime Commission is studying the idea.

The mother of one of the McLean High School victims said she was satisfied with the outcome of the case Monday. The Post does not generally name the victims of sex crimes, and will not identify them in this case.

“Hopefully it sends a strong message to other teens out there: Be careful what material you put out there, and if you see this material think twice about resdistributing it,” the woman wrote in an e-mail message. “It’s a scary new world for teenagers and their parents.”